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 009a0d9f6f)
This commit is contained in:
Denis Egorenko authored and Mergify committed 2024-12-20 17:28:40 +00:00
1 parent 6ce8e2ed32
commit eb036bfcb3
1 file changed
+1 -1
+1 -1
View File
@@ -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)