From 361bea43733432f34863143ab35d80b0f26495b1 Mon Sep 17 00:00:00 2001 From: hstanley Date: Wed, 3 Jul 2019 10:32:33 +0100 Subject: [PATCH] move List to util.go --- internal/pkg/cmd/reloader.go | 14 ++------------ internal/pkg/util/util.go | 11 +++++++++++ 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/internal/pkg/cmd/reloader.go b/internal/pkg/cmd/reloader.go index fb1c9ebe..7fbb9047 100644 --- a/internal/pkg/cmd/reloader.go +++ b/internal/pkg/cmd/reloader.go @@ -7,6 +7,7 @@ import ( "github.com/spf13/cobra" "github.com/stakater/Reloader/internal/pkg/controller" "github.com/stakater/Reloader/internal/pkg/options" + "github.com/stakater/Reloader/internal/pkg/util" "github.com/stakater/Reloader/pkg/kube" "k8s.io/apimachinery/pkg/apis/meta/v1" ) @@ -29,7 +30,7 @@ func NewReloaderCommand() *cobra.Command { } func startReloader(cmd *cobra.Command, args []string) { - var watchList List + var watchList util.List var err error logrus.Info("Starting Reloader") @@ -76,14 +77,3 @@ func startReloader(cmd *cobra.Command, args []string) { // Wait forever select {} } - -type List []string - -func (l *List) Contains(s string) bool { - for _, v := range *l { - if v == s { - return true - } - } - return false -} diff --git a/internal/pkg/util/util.go b/internal/pkg/util/util.go index c1e516a3..e0153f51 100644 --- a/internal/pkg/util/util.go +++ b/internal/pkg/util/util.go @@ -46,3 +46,14 @@ func GetSHAfromSecret(data map[string][]byte) string { sort.Strings(values) return crypto.GenerateSHA(strings.Join(values, ";")) } + +type List []string + +func (l *List) Contains(s string) bool { + for _, v := range *l { + if v == s { + return true + } + } + return false +}