Skip to content
This repository has been archived by the owner on Nov 22, 2018. It is now read-only.

ref(*): Use HELMC_HOME instead of HELM_HOME #460

Merged
merged 1 commit into from May 4, 2016
Merged

ref(*): Use HELMC_HOME instead of HELM_HOME #460

merged 1 commit into from May 4, 2016

Conversation

krancour
Copy link
Contributor

@krancour krancour commented May 3, 2016

Fixes #459

cc @kmala

@krancour krancour self-assigned this May 3, 2016
@krancour krancour added this to the 0.7.0 milestone May 3, 2016
@@ -20,6 +20,9 @@ func Generate(chart, homedir string, exclude []string, force bool) {
}
chartPath := util.WorkspaceChartDirectory(homedir, chart)

// Although helmc itself may use the new HELMC_HOME environment variable to optionally define its
// home directory, to maintain compatibility with charts created for the ORIGINAL helm, we
// continue to support expansion of these "legacy" environment variables, including HELM_HOME.
os.Setenv("HELM_HOME", homedir)
os.Setenv("HELM_DEFAULT_REPO", mustConfig(homedir).Repos.Default)
os.Setenv("HELM_FORCE_FLAG", strconv.FormatBool(force))
Copy link
Contributor

Choose a reason for hiding this comment

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

shouldn't we be setting the values for the HELMC_HOME and others so that when new charts are created and uses $HELMC_HOME it works?

Copy link
Contributor Author

@krancour krancour May 4, 2016

Choose a reason for hiding this comment

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

New charts should continue to use HELM_HOME. If people start using HELMC_HOME in charts, those charts won't work with older / original helm. This is addressed in the updated documentation I have also PR'ed. It ensures both backwards and forwards compatibility.

Re: whether we might want to additionally set HELMC_HOME, I believe the answer is no. Existing environment variables do get expanded here. This means if someone has HELMC_HOME set to a custom value, it will be properly inherited and interpreted by any possible invocation of the helmc binary in the generator header. If it is absent, the invocation of the helmc binary in the generator header will use the default helmc home dir, just as the initial invocation of helmc (by the user) would have.

The only thing we'd gain by setting HELMC_HOME is that chart authors would be able to use it for some custom command like the following:

#helm:generate sed -i s/foo/bar/ $HELMC_HOME/blah/blah

And that is precisely the thing we don't want chart authors doing because it will break their chart's compatibility with older / original helm. I feel that if we don't want them doing that, we shouldn't encourage that mistake by unnecessarily injecting a value into the HELMC_HOME env var when generators are invoked.

@mboersma mboersma added the LGTM1 label May 4, 2016
@kmala kmala added the LGTM2 label May 4, 2016
@krancour krancour merged commit e3645c7 into helm:master May 4, 2016
@krancour krancour deleted the change-helm-home branch May 4, 2016 16:24
gabrtv pushed a commit to gabrtv/helm that referenced this pull request Jun 30, 2016
fix(validate-go): show the errors gofmt found
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants