From 2229646c4134b20a43cfb386c4ed3e8371365286 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Tue, 1 Jun 2021 10:51:44 +0200 Subject: [PATCH] ceph: force upper case for Operator log level MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit When the operator configmap is edited, it is likely that some user will simply put "debug" instead of "DEBUG", so let's always transform the value to upper case to ease user experience. Signed-off-by: Sébastien Han --- pkg/operator/ceph/operator.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/operator/ceph/operator.go b/pkg/operator/ceph/operator.go index 62b601d074875..459e8bc4ea927 100644 --- a/pkg/operator/ceph/operator.go +++ b/pkg/operator/ceph/operator.go @@ -21,6 +21,7 @@ import ( "context" "os" "os/signal" + "strings" "syscall" "github.com/coreos/pkg/capnslog" @@ -109,7 +110,7 @@ func (o *Operator) updateOperatorLogLevel() error { rookLogLevel = "INFO" } - logLevel, err := capnslog.ParseLevel(rookLogLevel) + logLevel, err := capnslog.ParseLevel(strings.ToUpper(rookLogLevel)) if err != nil { return errors.Wrapf(err, "failed to load ROOK_LOG_LEVEL %q.", rookLogLevel) }