Skip to content

Commit 9c99693

Browse files
Remove FSS block-volume-snapshot
1 parent 27381f8 commit 9c99693

File tree

19 files changed

+33
-331
lines changed

19 files changed

+33
-331
lines changed

manifests/guestcluster/1.32/pvcsi.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,6 @@ data:
683683
"online-volume-extend": "true"
684684
"file-volume": "true"
685685
"csi-sv-feature-states-replication": "false" # Do not enable for guest cluster, Refer PR#2386 for details
686-
"block-volume-snapshot": "true"
687686
"tkgs-ha": "true"
688687
"cnsmgr-suspend-create-volume": "true"
689688
"csi-windows-support": "true"

manifests/guestcluster/1.33/pvcsi.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,6 @@ data:
663663
"online-volume-extend": "true"
664664
"file-volume": "true"
665665
"csi-sv-feature-states-replication": "false" # Do not enable for guest cluster, Refer PR#2386 for details
666-
"block-volume-snapshot": "true"
667666
"tkgs-ha": "true"
668667
"cnsmgr-suspend-create-volume": "true"
669668
"csi-windows-support": "true"

manifests/guestcluster/1.34/pvcsi.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -728,7 +728,6 @@ data:
728728
"online-volume-extend": "true"
729729
"file-volume": "true"
730730
"csi-sv-feature-states-replication": "false" # Do not enable for guest cluster, Refer PR#2386 for details
731-
"block-volume-snapshot": "true"
732731
"tkgs-ha": "true"
733732
"cnsmgr-suspend-create-volume": "true"
734733
"csi-windows-support": "true"

manifests/supervisorcluster/1.30/cns-csi.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -556,7 +556,6 @@ data:
556556
"csi-sv-feature-states-replication": "true"
557557
"fake-attach": "true"
558558
"improved-csi-idempotency": "true"
559-
"block-volume-snapshot": "true"
560559
"tkgs-ha": "true"
561560
"list-volumes": "true"
562561
"cnsmgr-suspend-create-volume": "true"

manifests/supervisorcluster/1.32/cns-csi.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,6 @@ data:
555555
"csi-sv-feature-states-replication": "true"
556556
"fake-attach": "true"
557557
"improved-csi-idempotency": "true"
558-
"block-volume-snapshot": "true"
559558
"tkgs-ha": "true"
560559
"list-volumes": "true"
561560
"cnsmgr-suspend-create-volume": "true"

pkg/common/unittestcommon/utils.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ func GetFakeContainerOrchestratorInterface(orchestratorType int) (commonco.COCom
6363
featureStates: map[string]string{
6464
"csi-migration": "true",
6565
"file-volume": "true",
66-
"block-volume-snapshot": "true",
6766
"tkgs-ha": "true",
6867
"list-volumes": "true",
6968
"csi-internal-generated-cluster-id": "true",

pkg/csi/service/common/commonco/k8sorchestrator/k8sorchestrator.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,6 @@ func getReleasedVanillaFSS() map[string]struct{} {
391391
return map[string]struct{}{
392392
common.CSIMigration: {},
393393
common.OnlineVolumeExtend: {},
394-
common.BlockVolumeSnapshot: {},
395394
common.CSIWindowsSupport: {},
396395
common.ListVolumes: {},
397396
common.CnsMgrSuspendCreateVolume: {},

pkg/csi/service/common/constants.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -393,9 +393,6 @@ const (
393393
// CSIVolumeManagerIdempotency is the feature flag for idempotency handling
394394
// in CSI volume manager.
395395
CSIVolumeManagerIdempotency = "improved-csi-idempotency"
396-
// BlockVolumeSnapshot is the feature to support CSI Snapshots for block
397-
// volume on vSphere CSI driver.
398-
BlockVolumeSnapshot = "block-volume-snapshot"
399396
// CSIWindowsSupport is the feature to support csi block volumes for windows
400397
// node.
401398
CSIWindowsSupport = "csi-windows-support"

pkg/csi/service/vanilla/controller.go

Lines changed: 20 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -120,10 +120,7 @@ func (c *controller) Init(config *cnsconfig.Config, version string) error {
120120
var err error
121121
var operationStore cnsvolumeoperationrequest.VolumeOperationRequest
122122
operationStore, err = cnsvolumeoperationrequest.InitVolumeOperationRequestInterface(ctx,
123-
config.Global.CnsVolumeOperationRequestCleanupIntervalInMin,
124-
func() bool {
125-
return commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx, common.BlockVolumeSnapshot)
126-
}, false)
123+
config.Global.CnsVolumeOperationRequestCleanupIntervalInMin, false)
127124
if err != nil {
128125
log.Errorf("failed to initialize VolumeOperationRequestInterface with error: %v", err)
129126
return err
@@ -523,13 +520,12 @@ func (c *controller) createBlockVolume(ctx context.Context, req *csi.CreateVolum
523520
volSizeMB := int64(common.RoundUpSize(volSizeBytes, common.MbInBytes))
524521

525522
// Check if the feature states are enabled.
526-
isBlockVolumeSnapshotEnabled := commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx, common.BlockVolumeSnapshot)
527523
csiMigrationFeatureState := commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx, common.CSIMigration)
528524

529525
// Check if requested volume size and source snapshot size matches
530526
volumeSource := req.GetVolumeContentSource()
531527
var contentSourceSnapshotID string
532-
if isBlockVolumeSnapshotEnabled && volumeSource != nil {
528+
if volumeSource != nil {
533529
isCnsSnapshotSupported, err := c.manager.VcenterManager.IsCnsSnapshotSupported(ctx,
534530
c.manager.VcenterConfig.Host)
535531
if err != nil {
@@ -2173,8 +2169,7 @@ func (c *controller) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequ
21732169
volumeType = convertCnsVolumeType(ctx, cnsVolumeType)
21742170
}
21752171
// Check if the volume contains CNS snapshots only for block volumes.
2176-
if cnsVolumeType == common.BlockVolumeType &&
2177-
commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx, common.BlockVolumeSnapshot) {
2172+
if cnsVolumeType == common.BlockVolumeType {
21782173
isCnsSnapshotSupported, err := vCenterManager.IsCnsSnapshotSupported(ctx, vCenterHost)
21792174
if err != nil {
21802175
return nil, csifault.CSIInternalFault, logger.LogNewErrorCodef(log, codes.Internal,
@@ -2588,28 +2583,27 @@ func (c *controller) ControllerExpandVolume(ctx context.Context, req *csi.Contro
25882583
volumeID := req.GetVolumeId()
25892584
volSizeBytes := int64(req.GetCapacityRange().GetRequiredBytes())
25902585
volSizeMB := int64(common.RoundUpSize(volSizeBytes, common.MbInBytes))
2586+
25912587
// Check if the volume contains CNS snapshots.
2592-
if commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx, common.BlockVolumeSnapshot) {
2593-
isCnsSnapshotSupported, err := vCenterManager.IsCnsSnapshotSupported(ctx, vCenterHost)
2588+
isCnsSnapshotSupported, err := vCenterManager.IsCnsSnapshotSupported(ctx, vCenterHost)
2589+
if err != nil {
2590+
return nil, csifault.CSIInternalFault, logger.LogNewErrorCodef(log, codes.Internal,
2591+
"failed to check if cns snapshot is supported on VC due to error: %v", err)
2592+
}
2593+
if isCnsSnapshotSupported {
2594+
snapshots, _, err := common.QueryVolumeSnapshotsByVolumeID(ctx, volumeManager, volumeID,
2595+
common.QuerySnapshotLimit)
25942596
if err != nil {
25952597
return nil, csifault.CSIInternalFault, logger.LogNewErrorCodef(log, codes.Internal,
2596-
"failed to check if cns snapshot is supported on VC due to error: %v", err)
2598+
"failed to retrieve snapshots for volume: %s. Error: %+v", volumeID, err)
25972599
}
2598-
if isCnsSnapshotSupported {
2599-
snapshots, _, err := common.QueryVolumeSnapshotsByVolumeID(ctx, volumeManager, volumeID,
2600-
common.QuerySnapshotLimit)
2601-
if err != nil {
2602-
return nil, csifault.CSIInternalFault, logger.LogNewErrorCodef(log, codes.Internal,
2603-
"failed to retrieve snapshots for volume: %s. Error: %+v", volumeID, err)
2604-
}
2605-
if len(snapshots) == 0 {
2606-
log.Infof("The volume %s can be safely expanded as no CNS snapshots were found.",
2607-
req.VolumeId)
2608-
} else {
2609-
return nil, csifault.CSIInvalidArgumentFault, logger.LogNewErrorCodef(log, codes.FailedPrecondition,
2610-
"volume: %s with existing snapshots %v cannot be expanded. "+
2611-
"Please delete snapshots before expanding the volume", req.VolumeId, snapshots)
2612-
}
2600+
if len(snapshots) == 0 {
2601+
log.Infof("The volume %s can be safely expanded as no CNS snapshots were found.",
2602+
req.VolumeId)
2603+
} else {
2604+
return nil, csifault.CSIInvalidArgumentFault, logger.LogNewErrorCodef(log, codes.FailedPrecondition,
2605+
"volume: %s with existing snapshots %v cannot be expanded. "+
2606+
"Please delete snapshots before expanding the volume", req.VolumeId, snapshots)
26132607
}
26142608
}
26152609

@@ -3015,11 +3009,6 @@ func (c *controller) CreateSnapshot(ctx context.Context, req *csi.CreateSnapshot
30153009
)
30163010
log.Infof("CreateSnapshot: called with args %+v", *req)
30173011

3018-
isBlockVolumeSnapshotEnabled := commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx, common.BlockVolumeSnapshot)
3019-
if !isBlockVolumeSnapshotEnabled {
3020-
return nil, logger.LogNewErrorCode(log, codes.Unimplemented, "createSnapshot")
3021-
}
3022-
30233012
volumeID := req.GetSourceVolumeId()
30243013
// Fetch vCenterHost, vCenterManager & volumeManager for given snapshot, based on VC configuration
30253014
vCenterManager = getVCenterManagerForVCenter(ctx, c)
@@ -3186,12 +3175,6 @@ func (c *controller) DeleteSnapshot(ctx context.Context, req *csi.DeleteSnapshot
31863175
)
31873176
log.Infof("DeleteSnapshot: called with args %+v", *req)
31883177

3189-
isBlockVolumeSnapshotEnabled :=
3190-
commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx, common.BlockVolumeSnapshot)
3191-
if !isBlockVolumeSnapshotEnabled {
3192-
return nil, logger.LogNewErrorCode(log, codes.Unimplemented, "deleteSnapshot")
3193-
}
3194-
31953178
volumeID, _, err := common.ParseCSISnapshotID(req.SnapshotId)
31963179
if err != nil {
31973180
return nil, logger.LogNewErrorCode(log, codes.InvalidArgument, err.Error())

pkg/csi/service/wcp/controller.go

Lines changed: 5 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -163,9 +163,7 @@ func (c *controller) Init(config *cnsconfig.Config, version string) error {
163163
log.Info("CSI Volume manager idempotency handling feature flag is enabled.")
164164
operationStore, err = cnsvolumeoperationrequest.InitVolumeOperationRequestInterface(ctx,
165165
config.Global.CnsVolumeOperationRequestCleanupIntervalInMin,
166-
func() bool {
167-
return commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx, common.BlockVolumeSnapshot)
168-
}, isPodVMOnStretchSupervisorFSSEnabled)
166+
isPodVMOnStretchSupervisorFSSEnabled)
169167
if err != nil {
170168
log.Errorf("failed to initialize VolumeOperationRequestInterface with error: %v", err)
171169
return err
@@ -395,9 +393,7 @@ func (c *controller) ReloadConfiguration(reconnectToVCFromNewConfig bool) error
395393
log.Info("CSI Volume manager idempotency handling feature flag is enabled.")
396394
operationStore, err = cnsvolumeoperationrequest.InitVolumeOperationRequestInterface(ctx,
397395
c.manager.CnsConfig.Global.CnsVolumeOperationRequestCleanupIntervalInMin,
398-
func() bool {
399-
return commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx, common.BlockVolumeSnapshot)
400-
}, isPodVMOnStretchSupervisorFSSEnabled)
396+
isPodVMOnStretchSupervisorFSSEnabled)
401397
if err != nil {
402398
log.Errorf("failed to initialize VolumeOperationRequestInterface with error: %v", err)
403399
return err
@@ -728,11 +724,10 @@ func (c *controller) createBlockVolume(ctx context.Context, req *csi.CreateVolum
728724
volSizeBytes = int64(req.GetCapacityRange().GetRequiredBytes())
729725
}
730726
volSizeMB := int64(common.RoundUpSize(volSizeBytes, common.MbInBytes))
731-
isBlockVolumeSnapshotEnabled := commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx, common.BlockVolumeSnapshot)
732727
// Check if requested volume size and source snapshot size matches
733728
volumeSource := req.GetVolumeContentSource()
734729
var contentSourceSnapshotID string
735-
if isBlockVolumeSnapshotEnabled && volumeSource != nil {
730+
if volumeSource != nil {
736731
sourceSnapshot := volumeSource.GetSnapshot()
737732
if sourceSnapshot == nil {
738733
return nil, csifault.CSIInvalidArgumentFault,
@@ -1695,8 +1690,7 @@ func (c *controller) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequ
16951690
volumeType = convertCnsVolumeType(ctx, cnsVolumeType)
16961691
}
16971692
// Check if the volume contains CNS snapshots only for block volumes.
1698-
if cnsVolumeType == common.BlockVolumeType &&
1699-
commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx, common.BlockVolumeSnapshot) {
1693+
if cnsVolumeType == common.BlockVolumeType {
17001694
snapshots, _, err := common.QueryVolumeSnapshotsByVolumeID(ctx, c.manager.VolumeManager, req.VolumeId,
17011695
common.QuerySnapshotLimit)
17021696
if err != nil {
@@ -2380,10 +2374,6 @@ func (c *controller) CreateSnapshot(ctx context.Context, req *csi.CreateSnapshot
23802374
ctx = logger.NewContextWithLogger(ctx)
23812375
log := logger.GetLogger(ctx)
23822376
log.Infof("WCP CreateSnapshot: called with args %+v", *req)
2383-
isBlockVolumeSnapshotWCPEnabled := commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx, common.BlockVolumeSnapshot)
2384-
if !isBlockVolumeSnapshotWCPEnabled {
2385-
return nil, logger.LogNewErrorCode(log, codes.Unimplemented, "createSnapshot")
2386-
}
23872377
volumeType := prometheus.PrometheusUnknownVolumeType
23882378
createSnapshotInternal := func() (*csi.CreateSnapshotResponse, error) {
23892379
// Validate CreateSnapshotRequest
@@ -2524,10 +2514,6 @@ func (c *controller) DeleteSnapshot(ctx context.Context, req *csi.DeleteSnapshot
25242514
log.Infof("DeleteSnapshot: called with args %+v", *req)
25252515
volumeType := prometheus.PrometheusBlockVolumeType
25262516
start := time.Now()
2527-
isBlockVolumeSnapshotWCPEnabled := commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx, common.BlockVolumeSnapshot)
2528-
if !isBlockVolumeSnapshotWCPEnabled {
2529-
return nil, logger.LogNewErrorCode(log, codes.Unimplemented, "deleteSnapshot")
2530-
}
25312517
deleteSnapshotInternal := func() (*csi.DeleteSnapshotResponse, error) {
25322518
csiSnapshotID := req.GetSnapshotId()
25332519
isStorageQuotaM2FSSEnabled := commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx,
@@ -2600,10 +2586,6 @@ func (c *controller) ListSnapshots(ctx context.Context, req *csi.ListSnapshotsRe
26002586
log := logger.GetLogger(ctx)
26012587
volumeType := prometheus.PrometheusBlockVolumeType
26022588
log.Infof("ListSnapshots: called with args %+v", *req)
2603-
isBlockVolumeSnapshotWCPEnabled := commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx, common.BlockVolumeSnapshot)
2604-
if !isBlockVolumeSnapshotWCPEnabled {
2605-
return nil, logger.LogNewErrorCode(log, codes.Unimplemented, "listSnapshot")
2606-
}
26072589
listSnapshotsInternal := func() (*csi.ListSnapshotsResponse, error) {
26082590
err := validateWCPListSnapshotRequest(ctx, req)
26092591
if err != nil {
@@ -2671,8 +2653,7 @@ func (c *controller) ControllerExpandVolume(ctx context.Context, req *csi.Contro
26712653
}
26722654
volumeType = convertCnsVolumeType(ctx, cnsVolumeType)
26732655
}
2674-
if cnsVolumeType == common.BlockVolumeType &&
2675-
commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx, common.BlockVolumeSnapshot) {
2656+
if cnsVolumeType == common.BlockVolumeType {
26762657
snapshots, _, err := common.QueryVolumeSnapshotsByVolumeID(ctx, c.manager.VolumeManager, req.VolumeId,
26772658
common.QuerySnapshotLimit)
26782659
if err != nil {

0 commit comments

Comments
 (0)