Skip to content
Snippets Groups Projects
Commit a17ce7c4 authored by OZGCloud's avatar OZGCloud
Browse files

optional ingressClassName

parent 9c098802
No related branches found
No related tags found
No related merge requests found
...@@ -35,8 +35,8 @@ metadata: ...@@ -35,8 +35,8 @@ metadata:
name: {{ include "app.name" . }} name: {{ include "app.name" . }}
namespace: {{ include "app.namespace" . }} namespace: {{ include "app.namespace" . }}
spec: spec:
{{- if ne (.Values).cluster_env "dataport"}} {{- if and (.Values.ingress).className (ne (.Values).cluster_env "dataport") }}
ingressClassName: nginx ingressClassName: {{ .Values.ingress.className }}
{{- end }} {{- end }}
rules: rules:
- http: - http:
......
...@@ -36,9 +36,8 @@ tests: ...@@ -36,9 +36,8 @@ tests:
- equal: - equal:
path: metadata.annotations.[cert-manager.io/cluster-issuer] path: metadata.annotations.[cert-manager.io/cluster-issuer]
value: letsencrypt-prod value: letsencrypt-prod
- equal: - isNull:
path: spec.ingressClassName path: spec.ingressClassName
value: nginx
- equal: - equal:
path: spec.tls[0].secretName path: spec.tls[0].secretName
value: helm-goofy-tls value: helm-goofy-tls
...@@ -29,11 +29,8 @@ release: ...@@ -29,11 +29,8 @@ release:
templates: templates:
- templates/ingress.yaml - templates/ingress.yaml
tests: tests:
- it: should create ingress tls/ingressClass - it: should create ingress tls
asserts: asserts:
- equal:
path: spec.ingressClassName
value: nginx
- equal: - equal:
path: spec.tls[0].secretName path: spec.tls[0].secretName
value: helm-goofy-tls value: helm-goofy-tls
...@@ -73,3 +70,14 @@ tests: ...@@ -73,3 +70,14 @@ tests:
- equal: - equal:
path: metadata.annotations.[nginx.ingress.kubernetes.io/proxy-body-size] path: metadata.annotations.[nginx.ingress.kubernetes.io/proxy-body-size]
value: 42m value: 42m
- it: should not set ingressClassName
asserts:
- isNull:
path: spec.ingressClassName
- it: should set ingressClassName
set:
ingress.className: nginx
asserts:
- equal:
path: spec.ingressClassName
value: nginx
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment