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

podSpec: use the $ operator while generating secretKeyRefs #94

Closed

Conversation

craigcabrey
Copy link
Contributor

Inside of range, . refers to the current item during iteration, whereas $ refers to the global scope.

test.yaml:

image:
  extraSecrets:
    - key: SSO_CLIENT_ID
      value: test-value

before:

$ helm template release ./charts/vaultwarden -f test.yaml 
Error: template: vaultwarden/templates/statefulset.yaml:43:10: executing "vaultwarden/templates/statefulset.yaml" at <include "vaultwarden.podSpec" .>: error calling include: template: vaultwarden/templates/_podSpec.tpl:43:21: executing "vaultwarden.podSpec" at <include "vaultwarden.fullname" .>: error calling include: template: vaultwarden/templates/_helpers.tpl:15:14: executing "vaultwarden.fullname" at <.Values.fullnameOverride>: nil pointer evaluating interface {}.fullnameOverride

Use --debug flag to render out invalid YAML

after:

$ helm template release ./charts/vaultwarden -f test.yaml 
---
# Source: vaultwarden/templates/rbac.yaml
apiVersion: v1
kind: ServiceAccount
metadata:
  name: vaultwarden-svc
  namespace: default
  labels:
    app.kubernetes.io/component: vaultwarden
[snip]
          env:
            - name: SSO_CLIENT_ID
              valueFrom:
                secretKeyRef:
                  name: release-vaultwarden
                  key: SSO_CLIENT_ID
[snip]

@guerzon
Copy link
Owner

guerzon commented Jul 7, 2024

Thanks for the PR @craigcabrey, but I merged this via #97 since the chart version is updated there.

@guerzon guerzon closed this Jul 7, 2024
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

Successfully merging this pull request may close these issues.

2 participants