+7
-1
@@ -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()
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user