From 6b1a86b137fe72c20e03c4915f1ece92ead7544f Mon Sep 17 00:00:00 2001 From: Joe Lombrozo Date: Fri, 17 Nov 2023 16:06:36 -0500 Subject: [PATCH] clean up --- cmd/controller_cmd.go | 1 + cmd/version.go | 1 + hacks/env-to-docs.go | 1 + pkg/affected_apps/best_effort.go | 16 ++++++---------- 4 files changed, 9 insertions(+), 10 deletions(-) diff --git a/cmd/controller_cmd.go b/cmd/controller_cmd.go index 398ec7ec..fc3c77c3 100644 --- a/cmd/controller_cmd.go +++ b/cmd/controller_cmd.go @@ -11,6 +11,7 @@ import ( "github.com/rs/zerolog/log" "github.com/spf13/cobra" "github.com/spf13/viper" + "github.com/zapier/kubechecks/pkg" "github.com/zapier/kubechecks/pkg/config" "github.com/zapier/kubechecks/pkg/events" diff --git a/cmd/version.go b/cmd/version.go index d8a5bd8b..c84c98ea 100644 --- a/cmd/version.go +++ b/cmd/version.go @@ -4,6 +4,7 @@ import ( "fmt" "github.com/spf13/cobra" + "github.com/zapier/kubechecks/pkg" ) diff --git a/hacks/env-to-docs.go b/hacks/env-to-docs.go index 091cb9dc..1fefcc5d 100644 --- a/hacks/env-to-docs.go +++ b/hacks/env-to-docs.go @@ -10,6 +10,7 @@ import ( "github.com/spf13/cobra" "github.com/spf13/pflag" + "github.com/zapier/kubechecks/cmd" ) diff --git a/pkg/affected_apps/best_effort.go b/pkg/affected_apps/best_effort.go index 45297862..978d9ca8 100644 --- a/pkg/affected_apps/best_effort.go +++ b/pkg/affected_apps/best_effort.go @@ -7,15 +7,11 @@ import ( "strings" "github.com/rs/zerolog/log" + "github.com/zapier/kubechecks/pkg/config" ) -// TODO: move this out to config and or in an .kubechecks.yaml as well -var ( - HelmPath = []string{"apps/", "argocd/", "charts/", "manifests/"} - HelmFileTypes = []string{".yaml", ".yml", ".tpl"} - KustomizeSubPaths = []string{"base/", "bases/", "components/", "overlays/", "resources/"} -) +var KustomizeSubPaths = []string{"base/", "bases/", "components/", "overlays/", "resources/"} type BestEffort struct { repoName string @@ -29,7 +25,7 @@ func NewBestEffortMatcher(repoName string, repoFileList []string) *BestEffort { } } -func (b *BestEffort) AffectedApps(ctx context.Context, changeList []string) (AffectedItems, error) { +func (b *BestEffort) AffectedApps(_ context.Context, changeList []string) (AffectedItems, error) { appsMap := make(map[string]string) for _, file := range changeList { @@ -115,9 +111,9 @@ func isKustomizeApp(file string) bool { func isKustomizeBaseComponentsChange(file string) bool { return strings.Contains(file, "base/") || - strings.Contains(file, "bases/") || - strings.Contains(file, "components/") || - strings.Contains(file, "resources/") + strings.Contains(file, "bases/") || + strings.Contains(file, "components/") || + strings.Contains(file, "resources/") } func overlaysDir(file string) string {