From b6badd4d6a99ad431f54d94773ad278d0c7472f1 Mon Sep 17 00:00:00 2001 From: Tarun Chinmai Sekar Date: Wed, 30 Aug 2023 14:59:00 -0700 Subject: [PATCH] Allow passing linodeApitoken and region as secretRef --- deploy/chart/templates/ccm-linode.yaml | 3 ++- deploy/chart/templates/daemonset.yaml | 12 +++++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/deploy/chart/templates/ccm-linode.yaml b/deploy/chart/templates/ccm-linode.yaml index d879ef73..c9d83c94 100644 --- a/deploy/chart/templates/ccm-linode.yaml +++ b/deploy/chart/templates/ccm-linode.yaml @@ -8,4 +8,5 @@ stringData: apiToken: {{ required ".Values.apiToken required" .Values.apiToken }} region: {{ required ".Values.region required" .Values.region }} type: Opaque -{{- end }} \ No newline at end of file +{{- end }} + diff --git a/deploy/chart/templates/daemonset.yaml b/deploy/chart/templates/daemonset.yaml index 86335521..86d45dd5 100644 --- a/deploy/chart/templates/daemonset.yaml +++ b/deploy/chart/templates/daemonset.yaml @@ -40,15 +40,17 @@ spec: - name: LINODE_API_TOKEN valueFrom: secretKeyRef: - name: {{ .Values.secretRef.name | default "ccm-linode"}} - key: {{ .Values.secretRef.apiTokenRef | default "apiToken"}} + name: {{ if .Values.secretRef }}{{ .Values.secretRef.name | default "ccm-linode" }}{{ else }}"ccm-linode"{{ end }} + key: {{ if .Values.secretRef }}{{ .Values.secretRef.apiTokenRef | default "apiToken" }}{{ else }}"apiToken"{{ end }} - name: LINODE_REGION valueFrom: secretKeyRef: - name: {{ .Values.secretRef.name | default "ccm-linode"}} - key: {{ .Values.secretRef.regionRef | default "region"}} + name: {{ if .Values.secretRef }}{{ .Values.secretRef.name | default "ccm-linode" }}{{ else }}"ccm-linode"{{ end }} + key: {{ if .Values.secretRef }}{{ .Values.secretRef.regionRef | default "region" }}{{ else }}"region"{{ end }} + {{if .Values.env}} {{- toYaml .Values.env | nindent 12 }} + {{end}} volumes: - name: k8s hostPath: - path: /etc/kubernetes + path: /etc/kubernetes \ No newline at end of file