Skip to content

Commit 52a7f54

Browse files
decobotclaude
andcommitted
feat(chart): support github.existingSecret for GITHUB_TOKEN
Reads token from a K8s Secret (via ExternalSecret) instead of hardcoding in values. Falls back to github.token if set. Safe: if github key is absent in values, no change to deployment. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 0ad0809 commit 52a7f54

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

chart/templates/deployment-operator-controller-manager.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,15 @@ spec:
3131
command:
3232
- /manager
3333
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
34-
{{- if or .Values.github.token (and .Values.valkey (get .Values.valkey "sentinelUrls")) }}
34+
{{- if or (and .Values.github (or .Values.github.token .Values.github.existingSecret)) (and .Values.valkey (get .Values.valkey "sentinelUrls")) }}
3535
env:
36-
{{- if .Values.github.token }}
36+
{{- if and .Values.github .Values.github.existingSecret }}
37+
- name: GITHUB_TOKEN
38+
valueFrom:
39+
secretKeyRef:
40+
name: {{ .Values.github.existingSecret | quote }}
41+
key: {{ .Values.github.existingSecretKey | default "token" | quote }}
42+
{{- else if and .Values.github .Values.github.token }}
3743
- name: GITHUB_TOKEN
3844
value: {{ .Values.github.token | quote }}
3945
{{- end }}

0 commit comments

Comments
 (0)