From 6db75cc2575dcfd821591a8c1db26df7f8851275 Mon Sep 17 00:00:00 2001 From: jiefenghuang Date: Fri, 15 Mar 2024 17:22:21 +0800 Subject: [PATCH] fix: config acl (#4522) Signed-off-by: jiefenghuang --- cmd/config.go | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/cmd/config.go b/cmd/config.go index bade6d24d9d6..a47a6ca28ff9 100644 --- a/cmd/config.go +++ b/cmd/config.go @@ -243,10 +243,15 @@ func config(ctx *cli.Context) error { clientVer = true } case "enable-acl": - // cannot disable - if ctx.Bool(flag) { - format.EnableACL = true - format.MinClientVersion = "1.2.0-A" + if enableACL := ctx.Bool(flag); enableACL != format.EnableACL { + if enableACL { + msg.WriteString(fmt.Sprintf("%s: %v -> %v\n", flag, format.EnableACL, true)) + msg.WriteString(fmt.Sprintf("%s: %s -> %s\n", "min-client-version", format.MinClientVersion, "1.2.0-A")) + format.EnableACL = true + format.MinClientVersion = "1.2.0-A" + } else { + return errors.New("cannot disable acl") + } } } }