From b13a1723972e0091031fd46c64b5744c0a2d05c6 Mon Sep 17 00:00:00 2001 From: Viraj Kulkarni Date: Thu, 2 May 2024 16:49:16 -0700 Subject: [PATCH] Pass 2 : Updated name --- main.go | 2 +- pkg/common/Constants.go | 2 +- pkg/k8s-utils/utils/utils.go | 2 +- pkg/k8s-utils/utils/utils_test.go | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/main.go b/main.go index a3e707a..3c228bb 100644 --- a/main.go +++ b/main.go @@ -62,7 +62,7 @@ func main() { "Enable leader election for controller manager. "+ "Enabling this will ensure there is only one active controller manager.") flag.DurationVar(&flagReconcilerTime, "reconciler-time", 10*time.Hour, "The flippy reconciler time.") - flag.StringVar(&common.IgnoreMetadata, "ignore-metadata", "flippy-ignore", "Annotation (Rollout/Deployment) and Label (Namespace) to be ignored") + flag.StringVar(&common.IgnoreMetadataKey, "flippy-ignore-key", "flippy-ignore", "Annotation (Rollout/Deployment) and Label (Namespace) to be ignored") opts := zap.Options{ Development: true, diff --git a/pkg/common/Constants.go b/pkg/common/Constants.go index 29bcca0..28567f0 100644 --- a/pkg/common/Constants.go +++ b/pkg/common/Constants.go @@ -24,4 +24,4 @@ type RestartObjects struct { RestartConfig crdv1.StatusCheckConfig } -var IgnoreMetadata string +var IgnoreMetadataKey string diff --git a/pkg/k8s-utils/utils/utils.go b/pkg/k8s-utils/utils/utils.go index 07f375d..cbb80df 100644 --- a/pkg/k8s-utils/utils/utils.go +++ b/pkg/k8s-utils/utils/utils.go @@ -74,7 +74,7 @@ func StringArrayContains(s []string, str string) bool { } func IsStringMapSubset(masterMap map[string]string, subsetMap map[string]string) bool { - flippyIgnore, ok := masterMap[common.IgnoreMetadata] + flippyIgnore, ok := masterMap[common.IgnoreMetadataKey] if ok && strings.ToLower(flippyIgnore) == "true" { return false diff --git a/pkg/k8s-utils/utils/utils_test.go b/pkg/k8s-utils/utils/utils_test.go index a6946b8..e883b77 100644 --- a/pkg/k8s-utils/utils/utils_test.go +++ b/pkg/k8s-utils/utils/utils_test.go @@ -29,7 +29,7 @@ func TestIsStringMapSubset(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { if tt.args != "empty" { - common.IgnoreMetadata = tt.args + common.IgnoreMetadataKey = tt.args } if got := IsStringMapSubset(masterMap, subsetMap); got != tt.want { t.Errorf("IsStringMapSubset() = %v, want %v", got, tt.want)