Merge pull request #16 from gimlet-io/svcport-mapping

Ability to have different container and svcPort
This commit is contained in:
Laszlo Fogas
2021-04-28 10:08:11 +02:00
committed by GitHub
2 changed files with 20 additions and 1 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ metadata:
spec:
type: {{ if .Values.nodePortEnabled }}NodePort{{ else }}ClusterIP{{ end }}
ports:
- port: {{ .Values.containerPort }}
- port: {{ if .Values.svcPort }}{{ .Values.svcPort }}{{ else }}{{ .Values.containerPort }}{{ end }}
targetPort: http
protocol: TCP
name: http
@@ -0,0 +1,19 @@
suite: test deployment
templates:
- service.yaml
tests:
- it: Should set containerPort as default
set:
containerPort: 11111
asserts:
- equal:
path: spec.ports[0].port
value: 11111
- it: Should set svcPort if it is defined
set:
containerPort: 11111
svcPort: 22222
asserts:
- equal:
path: spec.ports[0].port
value: 22222