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

Change enable to "enable=" #5104

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion cmd/idp-openid-subcommands.go
Original file line number Diff line number Diff line change
Expand Up @@ -416,12 +416,16 @@ func (i idpConfig) String() string {
return "Not configured."
}

enableStr := "on"
// Determine required width for key column.
fieldColWidth := 0
for _, kv := range i.Info {
if fieldColWidth < len(kv.Key) {
fieldColWidth = len(kv.Key)
}
if kv.Key == "enable" {
enableStr = kv.Value
}
}
// Add 1 for the colon-suffix in each entry.
fieldColWidth++
Expand All @@ -439,7 +443,14 @@ func (i idpConfig) String() string {
PaddingLeft(1)

var lines []string
lines = append(lines, fmt.Sprintf("%s%s",
fieldColStyle.Render("enable:"),
valueColStyle.Render(enableStr),
))
for _, kv := range i.Info {
if kv.Key == "enable" {
continue
}
envStr := ""
if kv.IsCfg && kv.IsEnv {
envStr = " (environment)"
Expand Down Expand Up @@ -509,7 +520,7 @@ func idpEnableDisable(ctx *cli.Context, isOpenID, enable bool) error {
idpType = madmin.OpenidIDPCfg
}

configBody := "enable=on"
configBody := "enable="
if !enable {
configBody = "enable=off"
}
Expand Down
Loading