diff --git a/internal/flags/flags_test.go b/internal/flags/flags_test.go index e298622..cfb5510 100644 --- a/internal/flags/flags_test.go +++ b/internal/flags/flags_test.go @@ -82,7 +82,7 @@ func testGetSecretsFromFiles(t *testing.T, flagName string, expected string) { func TestHTTPAPIPeriodicPollsFlag(t *testing.T) { cmd := new(cobra.Command) - SetDefaults() + RegisterDockerFlags(cmd) RegisterSystemFlags(cmd) diff --git a/pkg/notifications/notifier_test.go b/pkg/notifications/notifier_test.go index 4cb35a6..e864a80 100644 --- a/pkg/notifications/notifier_test.go +++ b/pkg/notifications/notifier_test.go @@ -101,12 +101,12 @@ var _ = Describe("notifications", func() { When("passing a discord url to the slack notifier", func() { command := cmd.NewRootCommand() - flags.RegisterNotificationFlags(command) + flags.RegisterNotificationFlags() channel := "123456789" token := "abvsihdbau" color := notifications.ColorInt - hostname := notifications.GetHostname(command) + hostname := notifications.GetHostname() title := url.QueryEscape(notifications.GetTitle(hostname)) expected := fmt.Sprintf("discord://%s@%s?color=0x%x&colordebug=0x0&colorerror=0x0&colorinfo=0x0&colorwarn=0x0&title=%s&username=watchtower", token, channel, color, title) buildArgs := func(url string) []string { @@ -190,11 +190,11 @@ var _ = Describe("notifications", func() { When("converting a gotify service config into a shoutrrr url", func() { It("should return the expected URL", func() { command := cmd.NewRootCommand() - flags.RegisterNotificationFlags(command) + flags.RegisterNotificationFlags() token := "aaa" host := "shoutrrr.local" - hostname := notifications.GetHostname(command) + hostname := notifications.GetHostname() title := url.QueryEscape(notifications.GetTitle(hostname)) expectedOutput := fmt.Sprintf("gotify://%s/%s?title=%s", host, token, title)