From 73a61b42036ebbcf9656bd7f809f639e478626ce Mon Sep 17 00:00:00 2001 From: kannappanr <30541348+kannappanr@users.noreply.github.com> Date: Fri, 26 Oct 2018 12:51:57 -0700 Subject: [PATCH] Parse alias set via env variable while prsing encryption key (#2581) Check MC_HOSTS_ env variable also while looking for the alias to set encryption key Fixes #2580 --- cmd/config.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmd/config.go b/cmd/config.go index a06f7408..eb12f5a1 100644 --- a/cmd/config.go +++ b/cmd/config.go @@ -174,6 +174,13 @@ func getHostConfig(alias string) (*hostConfigV9, *probe.Error) { // mustGetHostConfig retrieves host specific configuration such as access keys, signature type. func mustGetHostConfig(alias string) *hostConfigV9 { hostCfg, _ := getHostConfig(alias) + // If alias is not found, + // look for it in the environment variable. + if hostCfg == nil { + if envConfig, ok := os.LookupEnv(mcEnvHostsPrefix + alias); ok { + hostCfg, _ = expandAliasFromEnv(envConfig) + } + } return hostCfg }