From 7579740d38bfc18c0a2ecfdd46a05089e868b057 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?nils=20m=C3=A5s=C3=A9n?= Date: Wed, 7 Sep 2022 15:05:48 +0200 Subject: [PATCH] use combined flags for notifications --- pkg/notifications/email.go | 2 +- pkg/notifications/gotify.go | 2 +- pkg/notifications/msteams.go | 2 +- pkg/notifications/slack.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/notifications/email.go b/pkg/notifications/email.go index 3ebb4c0..19542a9 100644 --- a/pkg/notifications/email.go +++ b/pkg/notifications/email.go @@ -25,7 +25,7 @@ type emailTypeNotifier struct { } func newEmailNotifier(c *cobra.Command, acceptedLogLevels []log.Level) t.ConvertibleNotifier { - flags := c.PersistentFlags() + flags := c.Flags() from, _ := flags.GetString("notification-email-from") to, _ := flags.GetString("notification-email-to") diff --git a/pkg/notifications/gotify.go b/pkg/notifications/gotify.go index a8c9ac4..973dde6 100644 --- a/pkg/notifications/gotify.go +++ b/pkg/notifications/gotify.go @@ -23,7 +23,7 @@ type gotifyTypeNotifier struct { } func newGotifyNotifier(c *cobra.Command, levels []log.Level) t.ConvertibleNotifier { - flags := c.PersistentFlags() + flags := c.Flags() apiURL := getGotifyURL(flags) token := getGotifyToken(flags) diff --git a/pkg/notifications/msteams.go b/pkg/notifications/msteams.go index be67d3b..232d535 100644 --- a/pkg/notifications/msteams.go +++ b/pkg/notifications/msteams.go @@ -21,7 +21,7 @@ type msTeamsTypeNotifier struct { func newMsTeamsNotifier(cmd *cobra.Command, acceptedLogLevels []log.Level) t.ConvertibleNotifier { - flags := cmd.PersistentFlags() + flags := cmd.Flags() webHookURL, _ := flags.GetString("notification-msteams-hook") if len(webHookURL) <= 0 { diff --git a/pkg/notifications/slack.go b/pkg/notifications/slack.go index 34d21a3..f72ae4d 100644 --- a/pkg/notifications/slack.go +++ b/pkg/notifications/slack.go @@ -20,7 +20,7 @@ type slackTypeNotifier struct { } func newSlackNotifier(c *cobra.Command, acceptedLogLevels []log.Level) t.ConvertibleNotifier { - flags := c.PersistentFlags() + flags := c.Flags() hookURL, _ := flags.GetString("notification-slack-hook-url") userName, _ := flags.GetString("notification-slack-identifier")