containerPortYaml to allow exotic port setups
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user