-
Notifications
You must be signed in to change notification settings - Fork 564
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
feat: state values #647
feat: state values #647
Conversation
157768d
to
2beb703
Compare
This adds `values` to state files as proposed in #640. ```yaml values: - key1: val1 - defaults.yaml environments: default: - values: - environments/default.yaml production: - values: - environments/production.yaml ``` `{{ .Valuese.key1 }}` evaluates to `val1` if and only if it is not overrode via the production or the default env, or command-line args. Resolves #640
2beb703
to
4ffb43a
Compare
@sgandon Unit tests are passing, but I'm not confident if it works. Would you mind trying? |
This is worth being followed-up with documentation updates once confirmed to work. |
@mumoshu I'll give it a try. |
From our initial tests this is working fine. |
@sgandon Great! Thanks for reporting |
Hi, this is a great feature that should be added to the documentation.
|
@mumoshu the error is: Getting this even when performing a simple exec function:
|
@dudicoco Where's your |
Perhaps you're missing
|
Adding |
Nice! Glad to hear it worked 😄 Regarding the behavior, this doesn't work:
It's due to a chicken-and-egg problem. To render |
#932 is the long term solution to avoid this (super unintuitive) behavior. I'd appreciate any feedback on the issue so that I am more confident with the solution and start implementing it. |
Thanks for the info @mumoshu, i'll definitely checkout the issue when I get a chance. |
Yep it's intentional as of today. In near future I'd like to extend #906 to helmfile.yaml and state values, so that helmfile build output only contains references to secrets. |
Thank you for the feedback though! It helps prioritizing what I should do next. |
Thanks @mumoshu.
To:
However, I end up with a list with no commas which I can't iterate over with the range function. |
I guess you would want this:
|
Unfortunately it doesn't work: |
Sorry but that error doesn't make sense to me without context. Are you by any chance just missing closing doublequote after |
|
@mumoshu couldn't get it to work with the above, do you need any other information? |
@dudicoco Hey! Would u mind sharing the output from |
|
Ah sry it should be |
Thanks @mumoshu, it worked!
I think it's an amazing way to both load up all of your helmfiles and template them within your main helmfile. |
Ok I spoke too soon :)
|
So the issue seems to be with |
Solved with the following:
|
This adds
values
to state files as proposed in #640.{{ .Valuese.key1 }}
evaluates toval1
if and only if it is not overrode via the production or the default env, or command-line args.Resolves #640