From eb036bfcb31cbecfb45fcaed4bdc761dc8e4d0d6 Mon Sep 17 00:00:00 2001 From: Denis Egorenko Date: Fri, 20 Dec 2024 18:56:38 +0400 Subject: [PATCH] mgr: fix label selector when updating mgr active label Fix label selector for watch-active mgr container: during update active mgr label, add missed app=rook-ceph-mgr label, to avoid setting label for mon pod. Resolves: #15208 Signed-off-by: Denis Egorenko degorenko@mirantis.com (cherry picked from commit 009a0d9f6f4118ff9071016a8ddcf0857aca7e4a) --- pkg/operator/ceph/cluster/mgr/mgr.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/operator/ceph/cluster/mgr/mgr.go b/pkg/operator/ceph/cluster/mgr/mgr.go index 13cbe397d..68ff354c1 100644 --- a/pkg/operator/ceph/cluster/mgr/mgr.go +++ b/pkg/operator/ceph/cluster/mgr/mgr.go @@ -252,7 +252,7 @@ func (c *Cluster) removeExtraMgrs(daemonIDs []string) { // Otherwise sets 'mgr_role: standby' label to manager pods. func (c *Cluster) SetMgrRoleLabel(daemonNameToUpdate string, isActive bool) error { pods, err := c.context.Clientset.CoreV1().Pods(c.clusterInfo.Namespace).List(c.clusterInfo.Context, metav1.ListOptions{ - LabelSelector: fmt.Sprintf("%s=%s", controller.DaemonIDLabel, daemonNameToUpdate), + LabelSelector: fmt.Sprintf("%s=%s,%s=%s", k8sutil.AppAttr, AppName, controller.DaemonIDLabel, daemonNameToUpdate), }) if err != nil { logger.Infof("cannot get pod for mgr daemon %s", daemonNameToUpdate)