Repository navigation
feat(netbird): env values take valueFrom #67
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -136,6 +136,19 @@ app.kubernetes.io/component: {{ .component }} | |
| {{- end -}} | ||
| {{- end -}} | ||
|
|
||
| {{/* One env entry: a literal, or a map holding only valueFrom, so a parent chart's default can be replaced per key. Context: name, value. */}} | ||
| {{- define "netbird.envEntry" -}} | ||
| - name: {{ .name }} | ||
| {{- if kindIs "map" .value }} | ||
| {{- if or (ne (len .value) 1) (not (hasKey .value "valueFrom")) }} | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Reject a null
Require
|
||
| {{- fail (printf "env.%s must be a string or a map with only valueFrom" .name) }} | ||
| {{- end }} | ||
| {{- toYaml .value | nindent 2 }} | ||
| {{- else }} | ||
| value: {{ .value | quote }} | ||
| {{- end }} | ||
| {{- end -}} | ||
|
|
||
| {{/* User-supplied environment entries. Context: values, reserved (names the chart sets). */}} | ||
| {{- define "netbird.env" -}} | ||
| {{- $names := list -}} | ||
|
|
@@ -150,8 +163,7 @@ app.kubernetes.io/component: {{ .component }} | |
| {{- $seen = append $seen $name -}} | ||
| {{- end -}} | ||
| {{- range $key := keys .values.env | sortAlpha }} | ||
| - name: {{ $key }} | ||
| value: {{ index $.values.env $key | quote }} | ||
| {{ include "netbird.envEntry" (dict "name" $key "value" (index $.values.env $key)) }} | ||
| {{- end }} | ||
| {{- with .values.envRaw }} | ||
| {{ toYaml . }} | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Document nested selector merging.
Helm also merges maps inside
valueFrom. If a base file setssecretKeyRefand an override setsconfigMapKeyRef, both remain and Kubernetes rejects the Deployment. (raw.githubusercontent.com)Document that the override must clear the old selector, for example with
secretKeyRef: null.