Skip to content

Commit 5982436

Browse files
authored
Initiate storage-quota Periodic syncs only after metasyncer is initialised (#3639)
1 parent 51701ef commit 5982436

File tree

1 file changed

+10
-7
lines changed

1 file changed

+10
-7
lines changed

pkg/syncer/metadatasyncer.go

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -479,13 +479,6 @@ func InitMetadataSyncer(ctx context.Context, clusterFlavor cnstypes.CnsClusterFl
479479
cnsvolumeinfov1alpha1.CnsVolumeInfoSingular, cnsVolumeInfoCRInformerErr)
480480
os.Exit(1)
481481
}
482-
// start periodic sync for storage quota
483-
err := initStorageQuotaPeriodicSync(ctx, metadataSyncer)
484-
if err != nil {
485-
log.Errorf("initStorageQuotaPeriodicSync: Failed to initialize the storagequota "+
486-
"periodic sync, with error Error: %v", err)
487-
os.Exit(1)
488-
}
489482
}
490483
}
491484

@@ -871,6 +864,16 @@ func InitMetadataSyncer(ctx context.Context, clusterFlavor cnstypes.CnsClusterFl
871864
break
872865
}
873866
}()
867+
isStorageQuotaM2Enabled := metadataSyncer.coCommonInterface.IsFSSEnabled(ctx, common.StorageQuotaM2)
868+
if isStorageQuotaM2Enabled {
869+
// start periodic sync for storage quota
870+
err := initStorageQuotaPeriodicSync(ctx, metadataSyncer)
871+
if err != nil {
872+
log.Errorf("initStorageQuotaPeriodicSync: Failed to initialize the storagequota "+
873+
"periodic sync, with error Error: %v", err)
874+
os.Exit(1)
875+
}
876+
}
874877
}
875878
}
876879
if metadataSyncer.clusterFlavor == cnstypes.CnsClusterFlavorGuest {

0 commit comments

Comments
 (0)