From 5aee0b1c9e2d9a9a0ca8929ba7233cb0ed07c0e1 Mon Sep 17 00:00:00 2001 From: Taran Pelkey Date: Tue, 4 Feb 2025 15:34:19 -0500 Subject: [PATCH] Change enable to "enable=" (#5104) --- cmd/idp-openid-subcommands.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/cmd/idp-openid-subcommands.go b/cmd/idp-openid-subcommands.go index ca0fd59b..3d678b3f 100644 --- a/cmd/idp-openid-subcommands.go +++ b/cmd/idp-openid-subcommands.go @@ -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++ @@ -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)" @@ -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" }