flux2 icon indicating copy to clipboard operation
flux2 copied to clipboard

flux envsubst --strict ignores kustomize.toolkit.fluxcd.io/substitute: disabled label

Open monotek opened this issue 11 months ago • 1 comments

Describe the bug

flux envsubst --strict ignores kustomize.toolkit.fluxcd.io/substitute: disabled label

Steps to reproduce

run "flux envsubst --strict" on a kustomization directory with a grafana dashboard which contains a "${Datasource}" var but also has the "kustomize.toolkit.fluxcd.io/substitute: disabled" label.

flux will complain:

✗ variable not set (strict mode): "Datasource"

Expected behavior

flux envsubst thros no error

Screenshots and recordings

No response

OS / Distro

github action

Flux version

2.4.0

Flux check

N/A

Git provider

No response

Container Registry provider

No response

Additional context

No response

Code of Conduct

  • [X] I agree to follow this project's Code of Conduct

monotek avatar Dec 10 '24 18:12 monotek

Currently the flux envsubst command behaves like the GNU envsubst with --strict being the only addition. The command is not aware of YAML nor Kubernetes types, it works by streaming the content of whatever is passed in stdin. I don't think we should be changing the current behaviour, this would mean a major breaking change, for example I use this command in various scripts that have nothing to do with YAML content.

I'm for implementing the Kubernetes-aware envsubst under some opt-in flag.

stefanprodan avatar Dec 11 '24 12:12 stefanprodan