move List to util.go

This commit is contained in:
hstanley
2019-07-03 10:32:33 +01:00
parent 59fd71d15f
commit 361bea4373
2 changed files with 13 additions and 12 deletions
+2 -12
View File
@@ -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
}
+11
View File
@@ -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
}