From 88c28d2adec3b4dbf713d00d9116edc93a4e2bc5 Mon Sep 17 00:00:00 2001 From: parth-gr Date: Fri, 30 May 2025 09:11:49 +0530 Subject: [PATCH] nfs: fix the skip reconcile call currently nfs is used as the unique selector for daemon id, which returns nfs: ocs-storagecluster-cephnfs-a Updating the has() to function to check the same label value (n.Name + "-" + id) Signed-off-by: parth-gr (cherry picked from commit 79f44a4660cd325bc26adebeff89f8e0ba56b485) --- pkg/operator/ceph/controller/spec.go | 2 +- pkg/operator/ceph/nfs/nfs.go | 2 +- pkg/operator/ceph/nfs/nfs_test.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/operator/ceph/controller/spec.go b/pkg/operator/ceph/controller/spec.go index bf2d623bf..34d73702c 100644 --- a/pkg/operator/ceph/controller/spec.go +++ b/pkg/operator/ceph/controller/spec.go @@ -995,7 +995,7 @@ func GetDaemonsToSkipReconcile(ctx context.Context, clusterd *clusterd.Context, result := sets.New[string]() for _, deployment := range deployments.Items { if daemonID, ok := deployment.Labels[daemonName]; ok { - logger.Infof("found %s %q pod to skip reconcile", daemonID, daemonName) + logger.Infof("found %q %q pod to skip reconcile", daemonID, daemonName) result.Insert(daemonID) } } diff --git a/pkg/operator/ceph/nfs/nfs.go b/pkg/operator/ceph/nfs/nfs.go index 725c93c67..6f63b3481 100644 --- a/pkg/operator/ceph/nfs/nfs.go +++ b/pkg/operator/ceph/nfs/nfs.go @@ -63,7 +63,7 @@ func (r *ReconcileCephNFS) upCephNFS(n *cephv1.CephNFS) error { for i := 0; i < n.Spec.Server.Active; i++ { id := k8sutil.IndexToName(i) - if nfsToSkipReconcile.Has(id) { + if nfsToSkipReconcile.Has(fmt.Sprintf("%s-%s", n.Name, id)) { logger.Warningf("skipping reconcile of nfs daemon %q with label %q", id, cephv1.SkipReconcileLabelKey) continue } diff --git a/pkg/operator/ceph/nfs/nfs_test.go b/pkg/operator/ceph/nfs/nfs_test.go index 1a05e6d0a..90323eb34 100644 --- a/pkg/operator/ceph/nfs/nfs_test.go +++ b/pkg/operator/ceph/nfs/nfs_test.go @@ -216,7 +216,7 @@ func TestReconcileCephNFS_upCephNFS(t *testing.T) { func TestUpCephNFS_SkipsReconcile(t *testing.T) { ns := "skip-nfs-test" s := scheme.Scheme - daemonID := "a" + daemonID := "my-nfs-a" clientset := k8sfake.NewSimpleClientset() client := fake.NewClientBuilder().WithScheme(s).Build()