From c562986aa6eee96135aac9889a3ca2badfe434b1 Mon Sep 17 00:00:00 2001 From: Tin Lam Date: Mon, 6 Jul 2020 22:06:29 -0500 Subject: [PATCH] chore(certs): add labels This patch set adds in the manifests guards and labels for the cert-manager Issuer. Change-Id: Ibcb45f9617be2b2ebde6d2b2695bfa6b358b2079 Signed-off-by: Tin Lam --- ca-issuer/requirements.yaml | 5 ++++- ca-issuer/templates/issuer-ca.yaml | 5 +++++ ca-issuer/templates/secret-ca.yaml | 2 ++ ca-issuer/values.yaml | 4 ++++ 4 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ca-issuer/requirements.yaml b/ca-issuer/requirements.yaml index 27fb08a13..efd01ef7a 100644 --- a/ca-issuer/requirements.yaml +++ b/ca-issuer/requirements.yaml @@ -11,5 +11,8 @@ # limitations under the License. --- -dependencies: [] +dependencies: + - name: helm-toolkit + repository: http://localhost:8879/charts + version: 0.1.0 ... diff --git a/ca-issuer/templates/issuer-ca.yaml b/ca-issuer/templates/issuer-ca.yaml index 0ac29ffac..01af5f337 100644 --- a/ca-issuer/templates/issuer-ca.yaml +++ b/ca-issuer/templates/issuer-ca.yaml @@ -12,13 +12,18 @@ See the License for the specific language governing permissions and limitations under the License. */}} +{{- if .Values.manifests.issuer }} +{{- $envAll := . }} --- apiVersion: cert-manager.io/v1alpha3 kind: Issuer metadata: name: {{ .Values.conf.ca.issuer.name }} namespace: {{ .Release.Namespace }} + labels: +{{ tuple $envAll "cert-manager" "issuer" | include "helm-toolkit.snippets.kubernetes_metadata_labels" | indent 4 }} spec: ca: secretName: {{ .Values.conf.ca.secret.name }} ... +{{- end }} diff --git a/ca-issuer/templates/secret-ca.yaml b/ca-issuer/templates/secret-ca.yaml index 8b345098f..5261a1df3 100644 --- a/ca-issuer/templates/secret-ca.yaml +++ b/ca-issuer/templates/secret-ca.yaml @@ -12,6 +12,7 @@ See the License for the specific language governing permissions and limitations under the License. */}} +{{- if .Values.manifests.secret_ca }} --- apiVersion: v1 kind: Secret @@ -22,3 +23,4 @@ data: tls.crt: {{ .Values.conf.ca.secret.crt | default "" | b64enc }} tls.key: {{ .Values.conf.ca.secret.key | default "" | b64enc }} ... +{{- end }} diff --git a/ca-issuer/values.yaml b/ca-issuer/values.yaml index 94f893a7c..614bd466c 100644 --- a/ca-issuer/values.yaml +++ b/ca-issuer/values.yaml @@ -18,4 +18,8 @@ conf: name: secret-name crt: null key: null + +manifests: + issuer: true + secret_ca: true ...