Skip to content

Commit

Permalink
Change enable to "enable="
Browse files Browse the repository at this point in the history
  • Loading branch information
taran-p committed Jan 6, 2025
1 parent 11ebe95 commit bbbc24c
Showing 1 changed file with 12 additions and 1 deletion.
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

0 comments on commit bbbc24c

Please sign in to comment.