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

OZG-3184 optional staging cert

parent c15b9de5
Branches
Tags
No related merge requests found
......@@ -4,7 +4,7 @@
## Unit-Tests
Für Unit-Tests wird das helm [helm-unittest](https://github.com/quintush/helm-unittest) plugin benötigt. Die Unit-Tests liegen im Verzeichnis src/test/helm
`helm unittest -f '../../test/helm/*.yaml' .`
`helm unittest -f '../../test/helm/*.yaml' -v '../../test/unit-values.yaml' .`
## SyntaxCheck
`helm template --debug -f test-values.yaml .`
......
......@@ -26,7 +26,11 @@ apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
annotations:
{{- if (.Values.ingress).use_staging_cert }}
cert-manager.io/cluster-issuer: letsencrypt-staging
{{- else }}
cert-manager.io/cluster-issuer: letsencrypt-prod
{{- end }}
name: {{ include "app.name" . }}
namespace: {{ include "app.namespace" . }}
spec:
......
......@@ -46,3 +46,25 @@ tests:
path: spec.ingressClassName
- isNull:
path: spec.tls[0].secretName
- it: should use default letsencrypt-prod cluster-issuer
asserts:
- equal:
path: metadata.annotations.[cert-manager.io/cluster-issuer]
value: letsencrypt-prod
- it: should use letsencrypt-staging cluster-issuer
set:
ingress.use_staging_cert: true
asserts:
- equal:
path: metadata.annotations.[cert-manager.io/cluster-issuer]
value: letsencrypt-staging
- it: should use letsencrypt-prod cluster-issuer
set:
ingress.use_staging_cert: false
asserts:
- equal:
path: metadata.annotations.[cert-manager.io/cluster-issuer]
value: letsencrypt-prod
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment