Skip to content

Commit d91ce38

Browse files
committed
OCPBUGS-59626: operator: don't react to events from all namespaces
An informer for an empty namespace will list resources from all namespaces and cluster level. This may be undesirable, as this makes the controller react to events from different namespaces, while we're only interested in cluster-level events for clusterInformers. This prevents kas-operator from becoming degraded when unrelated namespace secrets are corrupted, which was causing false positive degradations. The fix removes the empty string namespace parameter that was causing the operator to watch ALL namespaces, and instead uses cluster-level only informers as intended by library-go#1985. Fixes: OCPBUGS-59626 Related: library-go#1985
1 parent dd7bd0d commit d91ce38

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pkg/operator/starter.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,9 @@ func RunOperator(ctx context.Context, controllerContext *controllercmd.Controlle
129129
"openshift-etcd",
130130
"openshift-apiserver",
131131
)
132-
clusterInformers := v1helpers.NewKubeInformersForNamespaces(kubeClient, "")
132+
// OCPBUGS-59626: Use cluster-level informers only, don't watch all namespaces
133+
// Remove empty namespace ("") parameter to prevent watching ALL namespaces
134+
clusterInformers := v1helpers.NewKubeInformersForNamespaces(kubeClient)
133135

134136
configInformers := configv1informers.NewSharedInformerFactory(configClient, 10*time.Minute)
135137
operatorClient, dynamicInformersForAllNamespaces, err := genericoperatorclient.NewStaticPodOperatorClient(

0 commit comments

Comments
 (0)