From aae5bb6ebb17939797ff09a147fb512022f3826b Mon Sep 17 00:00:00 2001 From: Jean-Philippe Evrard Date: Wed, 9 Oct 2024 20:32:28 +0200 Subject: [PATCH] Raise the error levels for wrong flag If the notification url configuration is known to be not working, this should be raised as an error, not a warning. Without this, it would be easy to miss a misconfiguration. Signed-off-by: Jean-Philippe Evrard --- cmd/kured/main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/kured/main.go b/cmd/kured/main.go index 56ed3bd..1ab4b84 100644 --- a/cmd/kured/main.go +++ b/cmd/kured/main.go @@ -313,11 +313,11 @@ func validateNotificationURL(notifyURL string, slackHookURL string) string { log.Warnf("Deprecated flag(s). Please use --notify-url flag instead.") parsedURL, err := url.Parse(stripQuotes(slackHookURL)) if err != nil { - log.Warnf("slack-hook-url is not properly formatted... no notification will be sent: %v\n", err) + log.Errorf("slack-hook-url is not properly formatted... no notification will be sent: %v\n", err) return "" } if len(strings.Split(strings.Trim(parsedURL.Path, "/services/"), "/")) != 3 { - log.Warnf("slack-hook-url is not properly formatted... no notification will be sent: unexpected number of / in URL\n") + log.Errorf("slack-hook-url is not properly formatted... no notification will be sent: unexpected number of / in URL\n") return "" } return fmt.Sprintf("slack://%s", strings.Trim(parsedURL.Path, "/services/"))