Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support V10 generated config #1743

Merged
merged 1 commit into from Dec 22, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions pkg/credentials/file_minio_client.go
Expand Up @@ -113,6 +113,7 @@ type hostConfig struct {
type config struct {
Version string `json:"version"`
Hosts map[string]hostConfig `json:"hosts"`
Aliases map[string]hostConfig `json:"aliases"`
}

// loadAliass loads from the file pointed to by shared credentials filename for alias.
Expand All @@ -129,5 +130,10 @@ func loadAlias(filename, alias string) (hostConfig, error) {
if err = json.Unmarshal(configBytes, cfg); err != nil {
return hostConfig{}, err
}

if cfg.Version == "10" {
return cfg.Aliases[alias], nil
}

return cfg.Hosts[alias], nil
}