From 2351ee022fd9ea28084816ec6c5f3880eb456e2b Mon Sep 17 00:00:00 2001 From: Vincent Behar Date: Fri, 17 Feb 2023 09:22:15 +0100 Subject: [PATCH] fix: configmapref in the example --- examples/operator/templates/configmap-vars.yaml | 8 ++++++++ examples/operator/templates/deployment.yaml | 2 +- examples/operator/values.yaml | 2 ++ test_data/k8s-operator-kustomize.output | 8 ++++++++ 4 files changed, 19 insertions(+), 1 deletion(-) create mode 100644 examples/operator/templates/configmap-vars.yaml diff --git a/examples/operator/templates/configmap-vars.yaml b/examples/operator/templates/configmap-vars.yaml new file mode 100644 index 0000000..d6adbc5 --- /dev/null +++ b/examples/operator/templates/configmap-vars.yaml @@ -0,0 +1,8 @@ +apiVersion: v1 +kind: ConfigMap +metadata: + name: {{ include "operator.fullname" . }}-configmap-vars + labels: + {{- include "operator.labels" . | nindent 4 }} +data: + VAR4: {{ .Values.configmapVars.var4 | quote }} \ No newline at end of file diff --git a/examples/operator/templates/deployment.yaml b/examples/operator/templates/deployment.yaml index 678a3a9..2b0da41 100644 --- a/examples/operator/templates/deployment.yaml +++ b/examples/operator/templates/deployment.yaml @@ -60,7 +60,7 @@ spec: valueFrom: configMapKeyRef: key: VAR4 - name: my-operator-configmap-vars + name: {{ include "operator.fullname" . }}-configmap-vars - name: VAR5 valueFrom: fieldRef: diff --git a/examples/operator/values.yaml b/examples/operator/values.yaml index 98e6621..30ecb82 100644 --- a/examples/operator/values.yaml +++ b/examples/operator/values.yaml @@ -1,3 +1,5 @@ +configmapVars: + var4: value for var4 controllerManager: kubeRbacProxy: image: diff --git a/test_data/k8s-operator-kustomize.output b/test_data/k8s-operator-kustomize.output index 18c3f08..4075656 100644 --- a/test_data/k8s-operator-kustomize.output +++ b/test_data/k8s-operator-kustomize.output @@ -773,6 +773,14 @@ metadata: type: opaque --- apiVersion: v1 +data: + VAR4: value for var4 +kind: ConfigMap +metadata: + name: my-operator-configmap-vars + namespace: my-operator-system +--- +apiVersion: v1 kind: PersistentVolumeClaim metadata: name: my-operator-pvc-lim