From 02c0e8448d65097db921b0a2ebaeb93abfd130e4 Mon Sep 17 00:00:00 2001 From: Travis Nielsen Date: Wed, 8 Jan 2025 16:02:27 -0700 Subject: [PATCH] core: remove unnecessary param to watch namespaces Cleanup obsolete code where the context no longer needs to be passed as a parameter to determine the namespaces to watch. Signed-off-by: Travis Nielsen (cherry picked from commit 82c82bbe13e4e34e0dab5cf2aec9fc7427d3213d) --- pkg/operator/ceph/operator.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/operator/ceph/operator.go b/pkg/operator/ceph/operator.go index 410cdc526..e43ba8c78 100644 --- a/pkg/operator/ceph/operator.go +++ b/pkg/operator/ceph/operator.go @@ -131,7 +131,7 @@ func (o *Operator) runCRDManager() { // The operator config manager is also watching for changes here so if the operator config map // content changes for ROOK_CURRENT_NAMESPACE_ONLY we must reload the operator CRD manager - o.namespaceToWatch(opManagerContext) + o.namespaceToWatch() // Pass the parent context to the cluster controller so that the monitoring go routines can // consume it to terminate gracefully @@ -148,11 +148,11 @@ func (o *Operator) runCRDManager() { }() } -func (o *Operator) namespaceToWatch(context context.Context) { +func (o *Operator) namespaceToWatch() { currentNamespaceOnly, _ := k8sutil.GetOperatorSetting(opManagerContext, o.context.Clientset, opcontroller.OperatorSettingConfigMapName, "ROOK_CURRENT_NAMESPACE_ONLY", "true") if currentNamespaceOnly == "true" { o.config.NamespaceToWatch = o.config.OperatorNamespace - logger.Infof("watching the current namespace %q for a Ceph CRs", o.config.OperatorNamespace) + logger.Infof("watching the current namespace %q for Ceph CRs", o.config.OperatorNamespace) } else { o.config.NamespaceToWatch = v1.NamespaceAll logger.Infof("watching all namespaces for Ceph CRs")