diff --git a/src/main/helm/templates/ingress.yaml b/src/main/helm/templates/ingress.yaml index 228582256bc4ab1ae54e1ac4c3971434df41e4be..33678224adc6ee660b0a705a0350227c6ca08e7f 100644 --- a/src/main/helm/templates/ingress.yaml +++ b/src/main/helm/templates/ingress.yaml @@ -6,6 +6,9 @@ metadata: annotations: haproxy-ingress.github.io/ssl-passthrough: "true" spec: + {{- if (.Values.ingress).className }} + ingressClassName: {{ .Values.ingress.className }} + {{- end }} rules: - host: "{{ .Release.Name }}-{{ include "app.baseDomain" . }}" http: diff --git a/src/test/helm/ingress_test.yaml b/src/test/helm/ingress_test.yaml index 06b8b2327b88c54912252331477a3c4439afa6e3..668a3e7a24e986ec74c200ae106834b9424872b3 100644 --- a/src/test/helm/ingress_test.yaml +++ b/src/test/helm/ingress_test.yaml @@ -43,6 +43,19 @@ tests: - equal: path: metadata.annotations["haproxy-ingress.github.io/ssl-passthrough"] value: "true" + + - it: should not create ingress tls/ingressClass by default + asserts: + - isNull: + path: spec.ingressClassName + - it: should set ingress tls/ingressClass + set: + ingress: + className: ingress + asserts: + - equal: + path: spec.ingressClassName + value: ingress - it: should create rules correctly asserts: - equal: