mirror of
https://github.com/containrrr/watchtower.git
synced 2025-12-14 06:06:38 +01:00
Revert "feat(config): swap viper and cobra for config (#684)"
This reverts commit ff8cb884a0.
This commit is contained in:
parent
89119515af
commit
8b81fbd48d
12 changed files with 255 additions and 229 deletions
|
|
@ -32,7 +32,6 @@ func TestShoutrrrDefaultTemplate(t *testing.T) {
|
|||
func TestShoutrrrTemplate(t *testing.T) {
|
||||
cmd := new(cobra.Command)
|
||||
flags.RegisterNotificationFlags(cmd)
|
||||
flags.BindViperFlags(cmd)
|
||||
err := cmd.ParseFlags([]string{"--notification-template={{range .}}{{.Level}}: {{.Message}}{{println}}{{end}}"})
|
||||
|
||||
require.NoError(t, err)
|
||||
|
|
@ -56,7 +55,6 @@ func TestShoutrrrTemplate(t *testing.T) {
|
|||
func TestShoutrrrStringFunctions(t *testing.T) {
|
||||
cmd := new(cobra.Command)
|
||||
flags.RegisterNotificationFlags(cmd)
|
||||
flags.BindViperFlags(cmd)
|
||||
err := cmd.ParseFlags([]string{"--notification-template={{range .}}{{.Level | printf \"%v\" | ToUpper }}: {{.Message | ToLower }} {{.Message | Title }}{{println}}{{end}}"})
|
||||
|
||||
require.NoError(t, err)
|
||||
|
|
@ -79,8 +77,8 @@ func TestShoutrrrStringFunctions(t *testing.T) {
|
|||
|
||||
func TestShoutrrrInvalidTemplateUsesTemplate(t *testing.T) {
|
||||
cmd := new(cobra.Command)
|
||||
|
||||
flags.RegisterNotificationFlags(cmd)
|
||||
flags.BindViperFlags(cmd)
|
||||
err := cmd.ParseFlags([]string{"--notification-template={{"})
|
||||
|
||||
require.NoError(t, err)
|
||||
|
|
@ -110,7 +108,7 @@ type blockingRouter struct {
|
|||
sent chan bool
|
||||
}
|
||||
|
||||
func (b blockingRouter) Send(_ string, _ *types.Params) []error {
|
||||
func (b blockingRouter) Send(message string, params *types.Params) []error {
|
||||
_ = <-b.unlock
|
||||
b.sent <- true
|
||||
return nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue