fix: Makes use of svcPort within ingress, when defined;

This commit is contained in:
Martin James
2021-07-27 18:22:05 +02:00
parent efd5d819f3
commit b249805bf3
2 changed files with 24 additions and 1 deletions
+1 -1
View File
@@ -38,7 +38,7 @@ spec:
paths:
- backend:
serviceName: {{ $robustName }}
servicePort: {{ .root.Values.containerPort }}
servicePort: {{ if .root.Values.svcPort }}{{ .root.Values.svcPort }}{{ else }}{{ .root.Values.containerPort }}{{ end }}
{{- end }}
{{- with .Values.ingress }}
@@ -0,0 +1,23 @@
suite: test deployment
templates:
- ingress.yaml
tests:
- it: Should use container port
set:
ingress:
host: chart-example.local
containerPort: 1234
asserts:
- equal:
path: spec.rules[0].http.paths[0].backend.servicePort
value: 1234
- it: Should use service port
set:
ingress:
host: chart-example.local
svcPort: 1234
containerPort: 5678
asserts:
- equal:
path: spec.rules[0].http.paths[0].backend.servicePort
value: 1234