helm/cmd/helm
Matthew Fisher 8be42bae88
fix(helm): fix regression with TLS flags/environment variables not being parsed (#4657)
* fix(helm): fix regression with TLS flags/envvars

This change fixes some of the assumptions made in an earlier commit. Helm's TLS flags and environment variables were not respected because they were parsed well before execution (during settings.AddFlagsTLS()), causing erroneous behaviour at runtime. By re-introducing environment.Init(), Helm can properly parse environment variables at the correct time.

One change that had to occur in this PR is the fact that we need to call settings.Init() each time we call settings.AddFlagsTLS(). This is because each command owns its own FlagSet, so we need to parse each flagset to read and propagate the environment variables correctly.

I also noticed that we were maintaining two separate variables for each TLS value. Refactoring out some of the older code to all use the settings object makes the code much cleaner to read and fixes an issue where setting a flag or environment variable would propagate to the settings object, but we'd be reading from tlsEnable.

I've also added some unit tests to ensure this regression doesn't occur again.

Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>

* fix bug where os.ExpandEnv() on the default value causes differing behaviour

Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>

* add more context to the TODO/FIXME messages

Signed-off-by: Matthew Fisher <matt.fisher@microsoft.com>
2018-09-19 11:20:32 -07:00
..
installer Make ping() request a specific image. Add a getTillerPodImage method. (#4622) 2018-09-17 14:04:19 -07:00
search change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
testdata change kubernetes to helm in docs and yaml files when refer the repository (#4640) 2018-09-14 07:36:11 -07:00
completion.go Merge pull request #4338 from dustyrip/zsh-compinit-patch 2018-08-24 11:23:42 -07:00
create.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
create_test.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
delete.go fix(helm): fix regression with TLS flags/environment variables not being parsed (#4657) 2018-09-19 11:20:32 -07:00
delete_test.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
dependency.go Merge pull request #4202 from bacongobbler/change-copyright 2018-07-31 08:57:02 -07:00
dependency_build.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
dependency_build_test.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
dependency_test.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
dependency_update.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
dependency_update_test.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
docs.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
fetch.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
fetch_test.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
get.go fix(helm): fix regression with TLS flags/environment variables not being parsed (#4657) 2018-09-19 11:20:32 -07:00
get_hooks.go fix(helm): fix regression with TLS flags/environment variables not being parsed (#4657) 2018-09-19 11:20:32 -07:00
get_hooks_test.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
get_manifest.go fix(helm): fix regression with TLS flags/environment variables not being parsed (#4657) 2018-09-19 11:20:32 -07:00
get_manifest_test.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
get_notes.go fix(helm): fix regression with TLS flags/environment variables not being parsed (#4657) 2018-09-19 11:20:32 -07:00
get_notes_test.go feat(helm): added new helm notes command to display notes provided by the chart of a release 2018-09-02 05:43:13 -04:00
get_test.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
get_values.go fix(helm): fix regression with TLS flags/environment variables not being parsed (#4657) 2018-09-19 11:20:32 -07:00
get_values_test.go feat(helm): output option for helm get values command, allow json and yaml formats (#4596) 2018-09-10 12:00:57 -07:00
helm.go fix(helm): fix regression with TLS flags/environment variables not being parsed (#4657) 2018-09-19 11:20:32 -07:00
helm_test.go fix(helm): fix regression with TLS flags/environment variables not being parsed (#4657) 2018-09-19 11:20:32 -07:00
history.go fix(helm): fix regression with TLS flags/environment variables not being parsed (#4657) 2018-09-19 11:20:32 -07:00
history_test.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
home.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
init.go fix(helm): fix regression with TLS flags/environment variables not being parsed (#4657) 2018-09-19 11:20:32 -07:00
init_test.go Merge pull request #3556 from ryane/fix/init-output-service 2018-07-31 10:10:41 -07:00
init_unix.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
init_windows.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
inspect.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
inspect_test.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
install.go fix(helm): fix regression with TLS flags/environment variables not being parsed (#4657) 2018-09-19 11:20:32 -07:00
install_test.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
lint.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
lint_test.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
list.go fix(helm): fix regression with TLS flags/environment variables not being parsed (#4657) 2018-09-19 11:20:32 -07:00
list_test.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
load_plugins.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
package.go [templates] extract some rendering code into a package 2018-08-06 17:24:02 -07:00
package_test.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
plugin.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
plugin_install.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
plugin_list.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
plugin_remove.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
plugin_test.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
plugin_update.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
printer.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
release_testing.go fix(helm): fix regression with TLS flags/environment variables not being parsed (#4657) 2018-09-19 11:20:32 -07:00
release_testing_test.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
repo.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
repo_add.go feat(helm): hiding password input on terminal 2018-08-27 11:39:10 +08:00
repo_add_test.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
repo_index.go Merge pull request #4284 from 0gajun/change_permission_index_yaml 2018-07-31 10:04:14 -07:00
repo_index_test.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
repo_list.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
repo_remove.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
repo_remove_test.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
repo_update.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
repo_update_test.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
reset.go fix(helm): fix regression with TLS flags/environment variables not being parsed (#4657) 2018-09-19 11:20:32 -07:00
reset_test.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
rollback.go fix(helm): fix regression with TLS flags/environment variables not being parsed (#4657) 2018-09-19 11:20:32 -07:00
rollback_test.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
search.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
search_test.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
serve.go fix merge conflicts/linter errors (#4653) 2018-09-17 09:48:51 -07:00
status.go fix(helm): fix regression with TLS flags/environment variables not being parsed (#4657) 2018-09-19 11:20:32 -07:00
status_test.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
template.go [templates] extract some rendering code into a package 2018-08-06 17:24:02 -07:00
template_test.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
upgrade.go fix(helm): fix regression with TLS flags/environment variables not being parsed (#4657) 2018-09-19 11:20:32 -07:00
upgrade_test.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
verify.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
verify_test.go change copyright to "Copyright The Helm Authors" 2018-07-30 08:29:17 -07:00
version.go fix(helm): fix regression with TLS flags/environment variables not being parsed (#4657) 2018-09-19 11:20:32 -07:00
version_test.go Fix for checking helm version slice bounds out of range (#4609) 2018-09-10 08:39:55 -07:00