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

Enable variable substitution on individual objects #849

Open
brovoca opened this issue May 2, 2023 · 2 comments
Open

Enable variable substitution on individual objects #849

brovoca opened this issue May 2, 2023 · 2 comments

Comments

@brovoca
Copy link

brovoca commented May 2, 2023

We can disable variable substitution on a particular object by setting the annotation kustomize.toolkit.fluxcd.io/substitute: disabled. However, I'd like to see the inverse of this, which means that I want to opt-in for variable substitution on particular objects - since I rarely substitute, and prefer the explicit annotation.

Use case

I store Grafana dashboard JSON files and Bash shell scripts in my Flux repo which I generate into ConfigMaps using configMapGenerator. Flux will then replace all variables, no matter if they are set or not.

Thus, the following shell script:

NAME="world"
echo "Hello ${NAME}!"

... will become:

NAME="world"
echo "Hello !"
@stefanprodan
Copy link
Member

The Kustomize ConfigMap generator allows you to set annotations on the generated objects, so you can set it once for all configs.

@brovoca
Copy link
Author

brovoca commented May 2, 2023

I am aware, and I am currently doing so. I prefer having the variables opt-in still, as I have a feeling it could produce unexpected results for those that don't pay attention.

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

2 participants