Skip to content
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

Add an environment variable for a custom token with an uppercase name #600

Open
srodenhuis opened this issue Jul 16, 2024 · 0 comments
Open

Comments

@srodenhuis
Copy link

When using the Helm chart with an additional key/value pair to be used as an environment variable for a custom token, the env in the deployment.yaml uses the $key as the name of the variable and the $key as the key for the secretKeyRef.

I would like to be able to use the following key/value pair:

credentials:
  extraEnvVars:
    my_token: <my-secret-token-here>

Resulting in a secretKeyRef where the name of the env is in uppercase:

- name: MY_TOKEN
  valueFrom:
    secretKeyRef:
      name: velero
      key: my_token 

proposed solution:

{{- with .Values.credentials.extraEnvVars }}
{{- range $key, $value := . }}
  - name: {{ default "none" (upper $key) }}
    valueFrom:
      secretKeyRef:
        name: {{ include "velero.secretName" $ }}
        key: {{ default "none" $key }}
{{- end }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant