containerPortYaml to allow exotic port setups

This commit is contained in:
Laszlo Fogas
2021-04-07 14:27:17 +02:00
parent 35831ac118
commit ec98a9d3ed
3 changed files with 49 additions and 1 deletions
+1 -1
View File
@@ -15,4 +15,4 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.17.0
version: 0.18.0
@@ -54,9 +54,13 @@ spec:
{{- end }}
{{- end }}
ports:
{{- if not .Values.containerPortYaml }}
- name: http
containerPort: {{ .Values.containerPort }}
protocol: TCP
{{ else }}
{{- toYaml .Values.containerPortYaml | nindent 12 }}
{{- end }}
{{- if .Values.probe.enabled }}
readinessProbe:
httpGet:
@@ -0,0 +1,44 @@
suite: test deployment
templates:
- deployment.yaml
- configmap.yaml
tests:
- it: Should set custom ports
set:
containerPortYaml:
- port: 21
targetPort: ftp
protocol: TCP
name: ftp
- port: 3001
targetPort: passive-1
protocol: TCP
name: passive-1
- port: 3002
targetPort: passive-2
protocol: TCP
name: passive-2
asserts:
- equal:
path: spec.template.spec.containers[0].ports
value:
- port: 21
targetPort: ftp
protocol: TCP
name: ftp
- port: 3001
targetPort: passive-1
protocol: TCP
name: passive-1
- port: 3002
targetPort: passive-2
protocol: TCP
name: passive-2
- it: Should set default port
asserts:
- equal:
path: spec.template.spec.containers[0].ports
value:
- name: http
containerPort: 80
protocol: TCP