diff --git a/charts/acme/Chart.yaml b/charts/acme/Chart.yaml index d2043c42e..700157d22 100644 --- a/charts/acme/Chart.yaml +++ b/charts/acme/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 description: An acme settings chart for Jenkins infra project name: acme -version: 0.1.2 +version: 0.1.3 home: "https://github.com/jenkins-infra/charts" maintainers: - name: Olblak diff --git a/charts/acme/templates/clusterIssuer.yaml b/charts/acme/templates/clusterIssuer.yaml index 167dad03e..c8141d180 100644 --- a/charts/acme/templates/clusterIssuer.yaml +++ b/charts/acme/templates/clusterIssuer.yaml @@ -9,5 +9,7 @@ spec: privateKeySecretRef: # Secret resource used to store the account's private key. name: {{ .Values.acme.id }} + {{- if .Values.acme.solvers }} solvers: {{- toYaml .Values.acme.solvers | nindent 4 }} + {{- end}} diff --git a/charts/acme/tests/custom_values_test.yaml b/charts/acme/tests/custom_values_test.yaml new file mode 100644 index 000000000..f27aae8d3 --- /dev/null +++ b/charts/acme/tests/custom_values_test.yaml @@ -0,0 +1,20 @@ +suite: Test with custom values +templates: + - clusterIssuer.yaml + - secret.yaml +tests: + - it: should create a Secret with the correct value + set: + acme: + clientSecrets: + - name: acme-test-secret + value: password + template: secret.yaml + asserts: + - hasDocuments: + count: 1 + - isKind: + of: Secret + - equal: + path: data.CLIENT_SECRET + value: cGFzc3dvcmQ= diff --git a/charts/acme/tests/defaults_values_test.yaml b/charts/acme/tests/defaults_values_test.yaml new file mode 100644 index 000000000..fea6a6192 --- /dev/null +++ b/charts/acme/tests/defaults_values_test.yaml @@ -0,0 +1,10 @@ +suite: Test with default values +templates: + - clusterIssuer.yaml + - secret.yaml +tests: + - it: should create a cluster issuer by default + template: clusterIssuer.yaml + asserts: + - hasDocuments: + count: 1 diff --git a/charts/acme/values.yaml b/charts/acme/values.yaml index b563b5e01..e4306db26 100644 --- a/charts/acme/values.yaml +++ b/charts/acme/values.yaml @@ -9,8 +9,8 @@ acme: # Secrets used for dns01 settings clientSecrets: - - name: 'acme_test_secret' - value: 'password' + - name: acme-test-secret + value: "" # Accepts any values as defined here https://cert-manager.io/docs/configuration/acme/dns01/ dns01: {}