8000 Make .Environment values available in .gotmpl files. by paichinger · Pull Request #2000 · roboll/helmfile · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Make .Environment values available in .gotmpl files. #2000

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

Merged
merged 1 commit into from
Nov 4, 2021
Merged

Make .Environment values available in .gotmpl files. #2000

merged 1 commit into from
Nov 4, 2021

Conversation

paichinger
Copy link
Contributor
@paichinger paichinger commented Nov 3, 2021

Currently it's not possible to use .Environment values in *.gomtpl files. The documentation states the opposite:
https://github.com/roboll/helmfile#environment (2nd paragraph).
The problem is already described in #1090.
This PR fixes this bug.
Fixes #1090

Copy link
Collaborator
@mumoshu mumoshu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for the fix @pjotre86!

@mumoshu mumoshu merged commit ca6dd7a into roboll:master Nov 4, 2021
@lindhe
Copy link
lindhe commented Nov 4, 2021

How surprising. I've been using with Helmfile v0.141.0 .Environment.Name already, and it has been working fine. Is this PR just for .Environment.Values (.Environment.values?) or what's up?

@paichinger paichinger deleted the environment-values-in-gotmpl branch November 4, 2021 10:21
@paichinger
Copy link
Contributor Author

@lindhe :
Are you using {{ .Environment.Name }} in a *.gotmpl file (like here: https://github.com/roboll/helmfile#values-files-templates) or in a base helmfile?

@lindhe
Copy link
lindhe commented Nov 4, 2021

Yep, I'm using {{ .Environment.Name }} in a *.gotmpl file.

@paichinger
Copy link
Contributor Author

That's weird!
For me and the reporters in #1090 it was always empty, before I fixed it. I don't have an explanation why it is working for you as there are myriads of ways how helmfile can be used an I also don't have a complete overview code-wise...

@lindhe
Copy link
lindhe commented Nov 5, 2021

Weird indeed. It's not particularly important for me to figure out though, so as far as I'm concerned we can drop this topic. Just thought I'd bring it up, in case it helps the maintainer figure out some related bug...

@jduepmeier
Copy link

There are two different "values". One is on in releases and one in environments.

Before this patch the .Environment.Name in environments value files was not present.

releases:
- name: test
  values:
    - test.yaml.gotmpl # this was working
environments:
- test:
    values:
    - test.yaml.gotmpl # this was not working

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.

.Environment.Name is not set in environment values template
4 participants
0