diff --git a/manifests/supervisorcluster/1.28/cns-csi.yaml b/manifests/supervisorcluster/1.28/cns-csi.yaml index 263e43dabc..797e930729 100644 --- a/manifests/supervisorcluster/1.28/cns-csi.yaml +++ b/manifests/supervisorcluster/1.28/cns-csi.yaml @@ -377,6 +377,7 @@ spec: - "--leader-election-lease-duration=120s" - "--leader-election-renew-deadline=60s" - "--leader-election-retry-period=30s" + - "--storagequota-sync-interval=10m" env: - name: CLUSTER_FLAVOR value: "WORKLOAD" diff --git a/manifests/supervisorcluster/1.29/cns-csi.yaml b/manifests/supervisorcluster/1.29/cns-csi.yaml index 263e43dabc..797e930729 100644 --- a/manifests/supervisorcluster/1.29/cns-csi.yaml +++ b/manifests/supervisorcluster/1.29/cns-csi.yaml @@ -377,6 +377,7 @@ spec: - "--leader-election-lease-duration=120s" - "--leader-election-renew-deadline=60s" - "--leader-election-retry-period=30s" + - "--storagequota-sync-interval=10m" env: - name: CLUSTER_FLAVOR value: "WORKLOAD" diff --git a/manifests/supervisorcluster/1.30/cns-csi.yaml b/manifests/supervisorcluster/1.30/cns-csi.yaml index bef9d5e904..45c828390f 100644 --- a/manifests/supervisorcluster/1.30/cns-csi.yaml +++ b/manifests/supervisorcluster/1.30/cns-csi.yaml @@ -383,7 +383,7 @@ spec: - "--leader-election-lease-duration=120s" - "--leader-election-renew-deadline=60s" - "--leader-election-retry-period=30s" - - "--storagequota-sync-interval=30m" + - "--storagequota-sync-interval=10m" env: - name: CLUSTER_FLAVOR value: "WORKLOAD" diff --git a/pkg/syncer/metadatasyncer.go b/pkg/syncer/metadatasyncer.go index 0d5cd465de..4a7cc12011 100644 --- a/pkg/syncer/metadatasyncer.go +++ b/pkg/syncer/metadatasyncer.go @@ -853,8 +853,12 @@ func InitMetadataSyncer(ctx context.Context, clusterFlavor cnstypes.CnsClusterFl func initStorageQuotaPeriodicSync(ctx context.Context, metadataSyncer *metadataSyncInformer) error { log := logger.GetLogger(ctx).WithOptions() + if int(PeriodicSyncIntervalInMin.Minutes()) == 0 { + log.Info("initStorageQuotaPeriodicSync: sync interval is set to 0, " + + "will skip the Periodic Sync for storage quota") + return nil + } // create storagequotaperiodicsync CR - log.Info("initStorageQuotaPeriodicSync: Initialize the storage quota periodic sync") restConfig, err := config.GetConfig() if err != nil {