diff --git a/config-host-main.go b/config-host-main.go index 9333b8e4..ef566055 100644 --- a/config-host-main.go +++ b/config-host-main.go @@ -133,7 +133,13 @@ func mainConfigHost(ctx *cli.Context) { } func listHosts() { - config, err := newConfig() + conf := new(configV6) + conf.Version = globalMCConfigVersion + // make sure to allocate map's otherwise Golang + // exits silently without providing any errors + conf.Hosts = make(map[string]hostConfig) + conf.Aliases = make(map[string]string) + config, err := quick.New(conf) fatalIf(err.Trace(), "Failed to initialize ‘quick’ configuration data structure.") configPath := mustGetMcConfigPath() diff --git a/config.go b/config.go index 99744ea3..ef44efea 100644 --- a/config.go +++ b/config.go @@ -426,11 +426,19 @@ func migrateConfigV5ToV6() { confV6.Aliases["gcs"] = "https://storage.googleapis.com" confV6.Hosts = make(map[string]hostConfig) for host, hostConf := range mcConfigV5.Data().(*configV5).Hosts { - confV6.Hosts[host] = hostConf + confV6.Hosts[host] = hostConfig{ + AccessKeyID: hostConf.AccessKeyID, + SecretAccessKey: hostConf.SecretAccessKey, + API: hostConf.API, + } } for host, hostConf := range confV6.Hosts { if strings.Contains(host, "s3") { - confV6.Hosts["*s3*amazonaws.com"] = hostConf + confV6.Hosts["*s3*amazonaws.com"] = hostConfig{ + AccessKeyID: hostConf.AccessKeyID, + SecretAccessKey: hostConf.SecretAccessKey, + API: hostConf.API, + } break } }