-
Notifications
You must be signed in to change notification settings - Fork 568
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
Initial support for environment variables read from .env #1462
base: master
Are you sure you want to change the base?
Conversation
What is the status of this? I would like to have this feature |
Is there anyway we can load environment variable from |
They way this could be worked around for the time being is to source the .env file and then in your helmfile.yaml: ...
templates:
default: &default
values:
- vars/{{ requiredEnv "ENV" }}/values.yaml
- extraArgs:
dryRun: {{ env "DRY_RUN" }}
logLevel: {{ env "VERBOSE" }}
releases:
- name: my-release-name
chart: my-chart
<<: *default Here I have shortened the example but, basically we can override values.yaml entries source .env && helmfile apply For deploy environments, you could just use a directory structure and override the default chart values.yaml and use it in the template block and pass a YAML anchor ( The vars/ENV/values.yaml file would look like this: extraArgs: {}
# dryRun: true
# verbose: true |
Sorry for the radio silence. I was revisiting all the pending PRs today and finally had a chance to revisit this. This is mostly good, but what makes me hesitant to merge this is that this seems to automatically import envvars if there's Shouldn't this be an opt-in feature instead? For example, |
@mumoshu - That's a good point. Do you have any suggestions on how to implement opt in? |
@tonsV2 My idea is to add a string-file for Lines 46 to 50 in 87e5903
--env-file value like Lines 869 to 871 in 87e5903
func (c *Context) newTemplate() *template.Template { and godot.load there, so that your template has access to RequiredEng and GetEnv functions that made aware of envvars from the env file.
|
This #1461 led to this pull request.
Not only is this my first contribution in Go this is also the very first Go code that I've written so please tell me what I've done wrong.