diff --git a/charts/kubechecks/values.yaml b/charts/kubechecks/values.yaml index a7041817..4efc583a 100644 --- a/charts/kubechecks/values.yaml +++ b/charts/kubechecks/values.yaml @@ -4,7 +4,7 @@ commonLabels: {} configMap: create: false env: {} - # KUBECHECKS_ALLOWED_NAMESPACES: default,namespace-a + # KUBECHECKS_ADDITIONAL_NAMESPACES: default,namespace-a # KUBECHECKS_ARGOCD_API_INSECURE: "false" # KUBECHECKS_ARGOCD_API_PATH_PREFIX: / # KUBECHECKS_ARGOCD_API_NAMESPACE: argocd diff --git a/docs/usage.md b/docs/usage.md index 57d0a71e..eee328bc 100644 --- a/docs/usage.md +++ b/docs/usage.md @@ -36,7 +36,7 @@ The full list of supported environment variables is described below: |Env Var|Description|Default Value| |-----------|-------------|------| -|`KUBECHECKS_ALLOWED_NAMESPACES`|Run Kubechecks in namespaced scope instead of cluster scope by specifying the namespaces of the Argo application to monitor.|`[]`| +|`KUBECHECKS_ADDITIONAL_NAMESPACES`|Additional namespaces other than the ArgoCDNamespace to monitor for applications.|`[]`| |`KUBECHECKS_ARGOCD_API_INSECURE`|Enable to use insecure connections over TLS to the ArgoCD API server.|`false`| |`KUBECHECKS_ARGOCD_API_NAMESPACE`|ArgoCD namespace where the application watcher will read Custom Resource Definitions (CRD) for Application and ApplicationSet resources.|`argocd`| |`KUBECHECKS_ARGOCD_API_PLAINTEXT`|Enable to use plaintext connections without TLS.|`false`| diff --git a/pkg/app_watcher/app_watcher.go b/pkg/app_watcher/app_watcher.go index defe4eb9..c4149bef 100644 --- a/pkg/app_watcher/app_watcher.go +++ b/pkg/app_watcher/app_watcher.go @@ -41,8 +41,6 @@ func NewApplicationWatcher(kubeCfg *rest.Config, vcsToArgoMap appdir.VcsToArgoMa ctrl := ApplicationWatcher{ applicationClientset: appclientset.NewForConfigOrDie(kubeCfg), vcsToArgoMap: vcsToArgoMap, - appInformer: []cache.SharedIndexInformer{}, - appLister: []applisters.ApplicationLister{}, } appInformer, appLister := ctrl.newApplicationInformerAndLister(time.Second*30, cfg) diff --git a/pkg/events/check.go b/pkg/events/check.go index e74791ef..a6b96ebd 100644 --- a/pkg/events/check.go +++ b/pkg/events/check.go @@ -4,7 +4,6 @@ import ( "context" "fmt" "reflect" - "slices" "strings" "sync" "sync/atomic" @@ -292,10 +291,6 @@ func (ce *CheckEvent) Process(ctx context.Context) error { ce.logger.Info().Msgf("adding %d apps to the queue", len(ce.affectedItems.Applications)) // Produce apps onto channel for _, app := range ce.affectedItems.Applications { - if len(ce.ctr.Config.AdditionalNamespaces) > 0 && !slices.Contains(ce.ctr.Config.AdditionalNamespaces, app.ObjectMeta.Namespace) { - ce.logger.Info().Msgf("skipping app %s, namespace %s not allowed", app.Name, app.ObjectMeta.Namespace) - continue - } ce.queueApp(app) }