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 <partharora1010@gmail.com>
This commit is contained in:
1 parent
13c9f8dbd3
commit
79f44a4660
3 files changed
+3
-3
No files matched your search
@@ -994,7 +994,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)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in new issue
Block a user