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

flux debug helmrelease Fails to Resolve valuesFrom Secret Reference #5221

Closed
1 task done
DanielAntos90 opened this issue Feb 28, 2025 · 2 comments · Fixed by #5227
Closed
1 task done

flux debug helmrelease Fails to Resolve valuesFrom Secret Reference #5221

DanielAntos90 opened this issue Feb 28, 2025 · 2 comments · Fixed by #5227
Assignees

Comments

@DanielAntos90
Copy link

DanielAntos90 commented Feb 28, 2025

Describe the bug

The new flux debug helmrelease feature fails when resolving valuesFrom references in a HelmRelease. We are using the grafana-k8s-monitoring Helm chart and passing authentication tokens via a Kubernetes Secret. The command fails with an unmarshalling error.

✗ could not resolve Secret chart values reference 'grafana/grafana-k8s-monitoring-helm-values-secret' with key 'accessPolicyToken': error unmarshaling JSON: while decoding JSON: json: cannot unmarshal string into Go value of type chartutil.Values

I have also tried podinfo helm chart without kind: Secret and it works fine.

Steps to reproduce

  1. Create a Kubernetes Secret with a key-value pair:
apiVersion: v1
kind: Secret
metadata:
  name: grafana-k8s-monitoring-helm-values-secret
data:
  accessPolicyToken: my-secret-token-base-64
type: Opaque

2.Reference the secret in a HelmRelease

spec:
  valuesFrom:
    - kind: Secret
      name: grafana-k8s-monitoring-helm-values-secret
      valuesKey: accessPolicyToken
      targetPath: externalServices.prometheus.basicAuth.password

3.Run flux debug helmrelease .
4.Observe the error.

Expected behavior

The flux debug helmrelease command should successfully resolve the valuesFrom reference and apply the secret value without errors.

Screenshots and recordings

No response

OS / Distro

macOS 15.3.1

Flux version

v2.5.1

Flux check

► checking prerequisites
✔ Kubernetes 1.30.10 >=1.30.0-0
► checking version in cluster
✔ distribution: flux-v2.5.1
✔ bootstrapped: true
► checking controllers
✔ helm-controller: deployment ready
► ghcr.io/fluxcd/helm-controller:v1.2.0
✔ kustomize-controller: deployment ready
► ghcr.io/fluxcd/kustomize-controller:v1.5.1
✔ notification-controller: deployment ready
► ghcr.io/fluxcd/notification-controller:v1.5.0
✔ source-controller: deployment ready
► ghcr.io/fluxcd/source-controller:v1.5.0
► checking crds
✔ alerts.notification.toolkit.fluxcd.io/v1beta3
✔ buckets.source.toolkit.fluxcd.io/v1
✔ gitrepositories.source.toolkit.fluxcd.io/v1
✔ helmcharts.source.toolkit.fluxcd.io/v1
✔ helmreleases.helm.toolkit.fluxcd.io/v2
✔ helmrepositories.source.toolkit.fluxcd.io/v1
✔ kustomizations.kustomize.toolkit.fluxcd.io/v1
✔ ocirepositories.source.toolkit.fluxcd.io/v1beta2
✔ providers.notification.toolkit.fluxcd.io/v1beta3
✔ receivers.notification.toolkit.fluxcd.io/v1
✔ all checks passed

Git provider

GitHub

Container Registry provider

GitHub

Additional context

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@matheuscscp matheuscscp self-assigned this Feb 28, 2025
@matheuscscp
Copy link
Member

I was able to reproduce this bug and am now investigating.

@matheuscscp
Copy link
Member

@DanielAntos90 If you build the CLI from the main branch the bug should be fixed now

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 a pull request may close this issue.

2 participants