diff --git a/templates/ingress.yaml b/templates/ingress.yaml index 538c80b..13e9114 100644 --- a/templates/ingress.yaml +++ b/templates/ingress.yaml @@ -24,7 +24,10 @@ spec: http: paths: - path: {{ .Values.ingress.path | quote }} + pathType: {{ .Values.ingress.pathType | default "ImplementationSpecific" | quote }} backend: - serviceName: {{ include "cmak.name" . | quote }} - servicePort: {{ .Values.ui.port }} + service: + name: {{ include "cmak.name" . | quote }} + port: + number: {{ .Values.ui.port }} {{- end }} diff --git a/test/linter/test.sh b/test/linter/test.sh index e0e50e5..5c97458 100755 --- a/test/linter/test.sh +++ b/test/linter/test.sh @@ -50,4 +50,8 @@ if [ $? -eq 0 ]; then exit 1 fi +helm lint . --strict --set 'ingress.pathType=true' +if [ $? -eq 0 ]; then + exit 1 +fi diff --git a/test/unit/ingress.yaml b/test/unit/ingress.yaml new file mode 100644 index 0000000..3ce2736 --- /dev/null +++ b/test/unit/ingress.yaml @@ -0,0 +1,31 @@ +suite: ingress +templates: + - ingress.yaml +tests: + - it: should not render by defaul + asserts: + - hasDocuments: + count: 0 + - it: should use pathType ImplementaionSpecific by default + set: + ingress: + host: myhost + path: / + asserts: + - hasDocuments: + count: 1 + - equal: + path: spec.rules[0].http.paths[0].pathType + value: ImplementationSpecific + - it: should use pathType ImplementaionSpecific by default + set: + ingress: + host: myhost + path: / + pathType: Prefix + asserts: + - hasDocuments: + count: 1 + - equal: + path: spec.rules[0].http.paths[0].pathType + value: Prefix diff --git a/values.schema.json b/values.schema.json index e7f860b..7370c69 100644 --- a/values.schema.json +++ b/values.schema.json @@ -174,6 +174,7 @@ "properties": { "host": { "type": "string", "title": "ingress host" }, "path": { "type": "string", "title": "ingress path" }, + "pathType": { "type": "string", "title": "ingress pathType", "default": "ImplementationSpecific" }, "tls": { "$ref": "#/definitions/tls" }, "labels": { "type": "object", "title": "optional ingress labels", "default": {} }, "annotations": { "type": "object", "title": "optional ingress annotations", "default": {} } diff --git a/values.yaml b/values.yaml index d86af74..22c30e5 100644 --- a/values.yaml +++ b/values.yaml @@ -114,6 +114,7 @@ ingress: null # # # ingress path # path: / + # pathType: ImplementationSpecific # # # Enable TLS configuration for the hostname defined at ingress.host # # secret name will be "${ingress.host.replace(".", "-")}"