Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion manifests/guestcluster/1.32/pvcsi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,6 @@ data:
"online-volume-extend": "true"
"file-volume": "true"
"csi-sv-feature-states-replication": "false" # Do not enable for guest cluster, Refer PR#2386 for details
"block-volume-snapshot": "true"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

query: why did we remove the fss from last n-2 yaml files only? do we want to remove from all earlier ones as well or do we not have any TKR release on older versions ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Per @chethanv28 , n-2 is apparently the convention CSI team follows for manifest updates. I presume there isn't really a point in updating older versions as code changes would also have to be backported to release branches or tag. You guys shouldn't me asking me this question. :)

"tkgs-ha": "true"
"cnsmgr-suspend-create-volume": "true"
"csi-windows-support": "true"
Expand Down
1 change: 0 additions & 1 deletion manifests/guestcluster/1.33/pvcsi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -663,7 +663,6 @@ data:
"online-volume-extend": "true"
"file-volume": "true"
"csi-sv-feature-states-replication": "false" # Do not enable for guest cluster, Refer PR#2386 for details
"block-volume-snapshot": "true"
"tkgs-ha": "true"
"cnsmgr-suspend-create-volume": "true"
"csi-windows-support": "true"
Expand Down
1 change: 0 additions & 1 deletion manifests/guestcluster/1.34/pvcsi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -728,7 +728,6 @@ data:
"online-volume-extend": "true"
"file-volume": "true"
"csi-sv-feature-states-replication": "false" # Do not enable for guest cluster, Refer PR#2386 for details
"block-volume-snapshot": "true"
"tkgs-ha": "true"
"cnsmgr-suspend-create-volume": "true"
"csi-windows-support": "true"
Expand Down
1 change: 0 additions & 1 deletion manifests/supervisorcluster/1.30/cns-csi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,6 @@ data:
"csi-sv-feature-states-replication": "true"
"fake-attach": "true"
"improved-csi-idempotency": "true"
"block-volume-snapshot": "true"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add same change, missed from manifests/supervisorcluster/1.31/cns-csi.yaml

"tkgs-ha": "true"
"list-volumes": "true"
"cnsmgr-suspend-create-volume": "true"
Expand Down
1 change: 0 additions & 1 deletion manifests/supervisorcluster/1.32/cns-csi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,6 @@ data:
"csi-sv-feature-states-replication": "true"
"fake-attach": "true"
"improved-csi-idempotency": "true"
"block-volume-snapshot": "true"
"tkgs-ha": "true"
"list-volumes": "true"
"cnsmgr-suspend-create-volume": "true"
Expand Down
1 change: 0 additions & 1 deletion pkg/common/unittestcommon/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ func GetFakeContainerOrchestratorInterface(orchestratorType int) (commonco.COCom
featureStates: map[string]string{
"csi-migration": "true",
"file-volume": "true",
"block-volume-snapshot": "true",
"tkgs-ha": "true",
"list-volumes": "true",
"csi-internal-generated-cluster-id": "true",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,6 @@ func getReleasedVanillaFSS() map[string]struct{} {
return map[string]struct{}{
common.CSIMigration: {},
common.OnlineVolumeExtend: {},
common.BlockVolumeSnapshot: {},
common.CSIWindowsSupport: {},
common.ListVolumes: {},
common.CnsMgrSuspendCreateVolume: {},
Expand Down
3 changes: 0 additions & 3 deletions pkg/csi/service/common/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,9 +393,6 @@ const (
// CSIVolumeManagerIdempotency is the feature flag for idempotency handling
// in CSI volume manager.
CSIVolumeManagerIdempotency = "improved-csi-idempotency"
// BlockVolumeSnapshot is the feature to support CSI Snapshots for block
// volume on vSphere CSI driver.
BlockVolumeSnapshot = "block-volume-snapshot"
// CSIWindowsSupport is the feature to support csi block volumes for windows
// node.
CSIWindowsSupport = "csi-windows-support"
Expand Down
57 changes: 20 additions & 37 deletions pkg/csi/service/vanilla/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,10 +120,7 @@ func (c *controller) Init(config *cnsconfig.Config, version string) error {
var err error
var operationStore cnsvolumeoperationrequest.VolumeOperationRequest
operationStore, err = cnsvolumeoperationrequest.InitVolumeOperationRequestInterface(ctx,
config.Global.CnsVolumeOperationRequestCleanupIntervalInMin,
func() bool {
return commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx, common.BlockVolumeSnapshot)
}, false)
config.Global.CnsVolumeOperationRequestCleanupIntervalInMin, false)
if err != nil {
log.Errorf("failed to initialize VolumeOperationRequestInterface with error: %v", err)
return err
Expand Down Expand Up @@ -523,13 +520,12 @@ func (c *controller) createBlockVolume(ctx context.Context, req *csi.CreateVolum
volSizeMB := int64(common.RoundUpSize(volSizeBytes, common.MbInBytes))

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

// Check if requested volume size and source snapshot size matches
volumeSource := req.GetVolumeContentSource()
var contentSourceSnapshotID string
if isBlockVolumeSnapshotEnabled && volumeSource != nil {
if volumeSource != nil {
isCnsSnapshotSupported, err := c.manager.VcenterManager.IsCnsSnapshotSupported(ctx,
c.manager.VcenterConfig.Host)
if err != nil {
Expand Down Expand Up @@ -2173,8 +2169,7 @@ func (c *controller) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequ
volumeType = convertCnsVolumeType(ctx, cnsVolumeType)
}
// Check if the volume contains CNS snapshots only for block volumes.
if cnsVolumeType == common.BlockVolumeType &&
commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx, common.BlockVolumeSnapshot) {
if cnsVolumeType == common.BlockVolumeType {
isCnsSnapshotSupported, err := vCenterManager.IsCnsSnapshotSupported(ctx, vCenterHost)
if err != nil {
return nil, csifault.CSIInternalFault, logger.LogNewErrorCodef(log, codes.Internal,
Expand Down Expand Up @@ -2588,28 +2583,27 @@ func (c *controller) ControllerExpandVolume(ctx context.Context, req *csi.Contro
volumeID := req.GetVolumeId()
volSizeBytes := int64(req.GetCapacityRange().GetRequiredBytes())
volSizeMB := int64(common.RoundUpSize(volSizeBytes, common.MbInBytes))

// Check if the volume contains CNS snapshots.
if commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx, common.BlockVolumeSnapshot) {
isCnsSnapshotSupported, err := vCenterManager.IsCnsSnapshotSupported(ctx, vCenterHost)
isCnsSnapshotSupported, err := vCenterManager.IsCnsSnapshotSupported(ctx, vCenterHost)
if err != nil {
return nil, csifault.CSIInternalFault, logger.LogNewErrorCodef(log, codes.Internal,
"failed to check if cns snapshot is supported on VC due to error: %v", err)
}
if isCnsSnapshotSupported {
snapshots, _, err := common.QueryVolumeSnapshotsByVolumeID(ctx, volumeManager, volumeID,
common.QuerySnapshotLimit)
if err != nil {
return nil, csifault.CSIInternalFault, logger.LogNewErrorCodef(log, codes.Internal,
"failed to check if cns snapshot is supported on VC due to error: %v", err)
"failed to retrieve snapshots for volume: %s. Error: %+v", volumeID, err)
}
if isCnsSnapshotSupported {
snapshots, _, err := common.QueryVolumeSnapshotsByVolumeID(ctx, volumeManager, volumeID,
common.QuerySnapshotLimit)
if err != nil {
return nil, csifault.CSIInternalFault, logger.LogNewErrorCodef(log, codes.Internal,
"failed to retrieve snapshots for volume: %s. Error: %+v", volumeID, err)
}
if len(snapshots) == 0 {
log.Infof("The volume %s can be safely expanded as no CNS snapshots were found.",
req.VolumeId)
} else {
return nil, csifault.CSIInvalidArgumentFault, logger.LogNewErrorCodef(log, codes.FailedPrecondition,
"volume: %s with existing snapshots %v cannot be expanded. "+
"Please delete snapshots before expanding the volume", req.VolumeId, snapshots)
}
if len(snapshots) == 0 {
log.Infof("The volume %s can be safely expanded as no CNS snapshots were found.",
req.VolumeId)
} else {
return nil, csifault.CSIInvalidArgumentFault, logger.LogNewErrorCodef(log, codes.FailedPrecondition,
"volume: %s with existing snapshots %v cannot be expanded. "+
"Please delete snapshots before expanding the volume", req.VolumeId, snapshots)
}
}

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

isBlockVolumeSnapshotEnabled := commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx, common.BlockVolumeSnapshot)
if !isBlockVolumeSnapshotEnabled {
return nil, logger.LogNewErrorCode(log, codes.Unimplemented, "createSnapshot")
}

volumeID := req.GetSourceVolumeId()
// Fetch vCenterHost, vCenterManager & volumeManager for given snapshot, based on VC configuration
vCenterManager = getVCenterManagerForVCenter(ctx, c)
Expand Down Expand Up @@ -3186,12 +3175,6 @@ func (c *controller) DeleteSnapshot(ctx context.Context, req *csi.DeleteSnapshot
)
log.Infof("DeleteSnapshot: called with args %+v", *req)

isBlockVolumeSnapshotEnabled :=
commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx, common.BlockVolumeSnapshot)
if !isBlockVolumeSnapshotEnabled {
return nil, logger.LogNewErrorCode(log, codes.Unimplemented, "deleteSnapshot")
}

volumeID, _, err := common.ParseCSISnapshotID(req.SnapshotId)
if err != nil {
return nil, logger.LogNewErrorCode(log, codes.InvalidArgument, err.Error())
Expand Down
29 changes: 5 additions & 24 deletions pkg/csi/service/wcp/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -163,9 +163,7 @@ func (c *controller) Init(config *cnsconfig.Config, version string) error {
log.Info("CSI Volume manager idempotency handling feature flag is enabled.")
operationStore, err = cnsvolumeoperationrequest.InitVolumeOperationRequestInterface(ctx,
config.Global.CnsVolumeOperationRequestCleanupIntervalInMin,
func() bool {
return commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx, common.BlockVolumeSnapshot)
}, isPodVMOnStretchSupervisorFSSEnabled)
isPodVMOnStretchSupervisorFSSEnabled)
if err != nil {
log.Errorf("failed to initialize VolumeOperationRequestInterface with error: %v", err)
return err
Expand Down Expand Up @@ -395,9 +393,7 @@ func (c *controller) ReloadConfiguration(reconnectToVCFromNewConfig bool) error
log.Info("CSI Volume manager idempotency handling feature flag is enabled.")
operationStore, err = cnsvolumeoperationrequest.InitVolumeOperationRequestInterface(ctx,
c.manager.CnsConfig.Global.CnsVolumeOperationRequestCleanupIntervalInMin,
func() bool {
return commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx, common.BlockVolumeSnapshot)
}, isPodVMOnStretchSupervisorFSSEnabled)
isPodVMOnStretchSupervisorFSSEnabled)
if err != nil {
log.Errorf("failed to initialize VolumeOperationRequestInterface with error: %v", err)
return err
Expand Down Expand Up @@ -728,11 +724,10 @@ func (c *controller) createBlockVolume(ctx context.Context, req *csi.CreateVolum
volSizeBytes = int64(req.GetCapacityRange().GetRequiredBytes())
}
volSizeMB := int64(common.RoundUpSize(volSizeBytes, common.MbInBytes))
isBlockVolumeSnapshotEnabled := commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx, common.BlockVolumeSnapshot)
// Check if requested volume size and source snapshot size matches
volumeSource := req.GetVolumeContentSource()
var contentSourceSnapshotID string
if isBlockVolumeSnapshotEnabled && volumeSource != nil {
if volumeSource != nil {
sourceSnapshot := volumeSource.GetSnapshot()
if sourceSnapshot == nil {
return nil, csifault.CSIInvalidArgumentFault,
Expand Down Expand Up @@ -1695,8 +1690,7 @@ func (c *controller) DeleteVolume(ctx context.Context, req *csi.DeleteVolumeRequ
volumeType = convertCnsVolumeType(ctx, cnsVolumeType)
}
// Check if the volume contains CNS snapshots only for block volumes.
if cnsVolumeType == common.BlockVolumeType &&
commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx, common.BlockVolumeSnapshot) {
if cnsVolumeType == common.BlockVolumeType {
snapshots, _, err := common.QueryVolumeSnapshotsByVolumeID(ctx, c.manager.VolumeManager, req.VolumeId,
common.QuerySnapshotLimit)
if err != nil {
Expand Down Expand Up @@ -2380,10 +2374,6 @@ func (c *controller) CreateSnapshot(ctx context.Context, req *csi.CreateSnapshot
ctx = logger.NewContextWithLogger(ctx)
log := logger.GetLogger(ctx)
log.Infof("WCP CreateSnapshot: called with args %+v", *req)
isBlockVolumeSnapshotWCPEnabled := commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx, common.BlockVolumeSnapshot)
if !isBlockVolumeSnapshotWCPEnabled {
return nil, logger.LogNewErrorCode(log, codes.Unimplemented, "createSnapshot")
}
volumeType := prometheus.PrometheusUnknownVolumeType
createSnapshotInternal := func() (*csi.CreateSnapshotResponse, error) {
// Validate CreateSnapshotRequest
Expand Down Expand Up @@ -2524,10 +2514,6 @@ func (c *controller) DeleteSnapshot(ctx context.Context, req *csi.DeleteSnapshot
log.Infof("DeleteSnapshot: called with args %+v", *req)
volumeType := prometheus.PrometheusBlockVolumeType
start := time.Now()
isBlockVolumeSnapshotWCPEnabled := commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx, common.BlockVolumeSnapshot)
if !isBlockVolumeSnapshotWCPEnabled {
return nil, logger.LogNewErrorCode(log, codes.Unimplemented, "deleteSnapshot")
}
deleteSnapshotInternal := func() (*csi.DeleteSnapshotResponse, error) {
csiSnapshotID := req.GetSnapshotId()
isStorageQuotaM2FSSEnabled := commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx,
Expand Down Expand Up @@ -2600,10 +2586,6 @@ func (c *controller) ListSnapshots(ctx context.Context, req *csi.ListSnapshotsRe
log := logger.GetLogger(ctx)
volumeType := prometheus.PrometheusBlockVolumeType
log.Infof("ListSnapshots: called with args %+v", *req)
isBlockVolumeSnapshotWCPEnabled := commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx, common.BlockVolumeSnapshot)
if !isBlockVolumeSnapshotWCPEnabled {
return nil, logger.LogNewErrorCode(log, codes.Unimplemented, "listSnapshot")
}
listSnapshotsInternal := func() (*csi.ListSnapshotsResponse, error) {
err := validateWCPListSnapshotRequest(ctx, req)
if err != nil {
Expand Down Expand Up @@ -2671,8 +2653,7 @@ func (c *controller) ControllerExpandVolume(ctx context.Context, req *csi.Contro
}
volumeType = convertCnsVolumeType(ctx, cnsVolumeType)
}
if cnsVolumeType == common.BlockVolumeType &&
commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx, common.BlockVolumeSnapshot) {
if cnsVolumeType == common.BlockVolumeType {
snapshots, _, err := common.QueryVolumeSnapshotsByVolumeID(ctx, c.manager.VolumeManager, req.VolumeId,
common.QuerySnapshotLimit)
if err != nil {
Expand Down
19 changes: 2 additions & 17 deletions pkg/csi/service/wcpguest/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -327,8 +327,7 @@ func (c *controller) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequ
}
volSizeMB := int64(common.RoundUpSize(volSizeBytes, common.MbInBytes))
volumeSource := req.GetVolumeContentSource()
if commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx, common.BlockVolumeSnapshot) &&
volumeSource != nil {
if volumeSource != nil {
sourceSnapshot := volumeSource.GetSnapshot()
if sourceSnapshot == nil {
return nil, csifault.CSIInvalidArgumentFault,
Expand Down Expand Up @@ -493,8 +492,7 @@ func (c *controller) CreateVolume(ctx context.Context, req *csi.CreateVolumeRequ
}

// Set the Snapshot VolumeContentSource in the CreateVolumeResponse
if commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx, common.BlockVolumeSnapshot) &&
volumeSnapshotName != "" {
if volumeSnapshotName != "" {
resp.Volume.ContentSource = &csi.VolumeContentSource{
Type: &csi.VolumeContentSource_Snapshot{
Snapshot: &csi.VolumeContentSource_SnapshotSource{
Expand Down Expand Up @@ -1603,11 +1601,6 @@ func (c *controller) CreateSnapshot(ctx context.Context, req *csi.CreateSnapshot
start := time.Now()
volumeType := prometheus.PrometheusBlockVolumeType
log.Infof("CreateSnapshot: called with args %+v", *req)
isBlockVolumeSnapshotWCPEnabled := commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx,
common.BlockVolumeSnapshot)
if !isBlockVolumeSnapshotWCPEnabled {
return nil, logger.LogNewErrorCode(log, codes.Unimplemented, "createSnapshot")
}
createSnapshotInternal := func() (*csi.CreateSnapshotResponse, error) {
// Search for supervisor PVC and ensure it exists
supervisorPVCName := req.SourceVolumeId
Expand Down Expand Up @@ -1735,10 +1728,6 @@ func (c *controller) DeleteSnapshot(ctx context.Context, req *csi.DeleteSnapshot
start := time.Now()
volumeType := prometheus.PrometheusBlockVolumeType
log.Infof("DeleteSnapshot: called with args %+v", *req)
isBlockVolumeSnapshotWCPEnabled := commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx, common.BlockVolumeSnapshot)
if !isBlockVolumeSnapshotWCPEnabled {
return nil, logger.LogNewErrorCode(log, codes.Unimplemented, "deleteSnapshot")
}
deleteSnapshotInternal := func() (*csi.DeleteSnapshotResponse, error) {
csiSnapshotID := req.GetSnapshotId()
// Retrieve the supervisor volumesnapshot
Expand Down Expand Up @@ -1828,10 +1817,6 @@ func (c *controller) ListSnapshots(ctx context.Context, req *csi.ListSnapshotsRe
start := time.Now()
volumeType := prometheus.PrometheusBlockVolumeType
log.Infof("ListSnapshots: called with args %+v", *req)
isBlockVolumeSnapshotEnabled := commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx, common.BlockVolumeSnapshot)
if !isBlockVolumeSnapshotEnabled {
return nil, logger.LogNewErrorCode(log, codes.Unimplemented, "listSnapshot")
}
listSnapshotsInternal := func() (*csi.ListSnapshotsResponse, error) {
log.Infof("ListSnapshots: called with args %+v", *req)
maxEntries := common.QuerySnapshotLimit
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ var (
// VolumeOperationRequest interface. Clients are unaware of the implementation
// details to read and persist volume operation details.
func InitVolumeOperationRequestInterface(ctx context.Context, cleanupInterval int,
isBlockVolumeSnapshotEnabled func() bool, isPodVMOnStretchSupervisorEnabled bool) (
isPodVMOnStretchSupervisorEnabled bool) (
VolumeOperationRequest, error) {
log := logger.GetLogger(ctx)
csiNamespace = getCSINamespace()
Expand Down
6 changes: 1 addition & 5 deletions pkg/syncer/admissionhandler/admissionhandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ var (
// CO agnostic orchestrator in the admission handler package.
COInitParams *interface{}
featureGateCsiMigrationEnabled bool
featureGateBlockVolumeSnapshotEnabled bool
featureGateTKGSHaEnabled bool
featureGateTopologyAwareFileVolumeEnabled bool
featureGateByokEnabled bool
Expand Down Expand Up @@ -145,7 +144,6 @@ func StartWebhookServer(ctx context.Context, enableWebhookClientCertVerification

if clusterFlavor == cnstypes.CnsClusterFlavorWorkload {
featureGateTKGSHaEnabled = containerOrchestratorUtility.IsFSSEnabled(ctx, common.TKGsHA)
featureGateBlockVolumeSnapshotEnabled = containerOrchestratorUtility.IsFSSEnabled(ctx, common.BlockVolumeSnapshot)
featureGateByokEnabled = containerOrchestratorUtility.IsFSSEnabled(ctx, common.WCP_VMService_BYOK)
featureIsSharedDiskEnabled = containerOrchestratorUtility.IsFSSEnabled(ctx, common.SharedDiskFss)
featureFileVolumesWithVmServiceEnabled = containerOrchestratorUtility.IsFSSEnabled(ctx,
Expand All @@ -158,7 +156,6 @@ func StartWebhookServer(ctx context.Context, enableWebhookClientCertVerification
}
} else if clusterFlavor == cnstypes.CnsClusterFlavorGuest {
featureIsLinkedCloneSupportEnabled = containerOrchestratorUtility.IsFSSEnabled(ctx, common.LinkedCloneSupport)
featureGateBlockVolumeSnapshotEnabled = containerOrchestratorUtility.IsFSSEnabled(ctx, common.BlockVolumeSnapshot)
startPVCSIWebhookManager(ctx)
} else if clusterFlavor == cnstypes.CnsClusterFlavorVanilla {
if cfg == nil {
Expand All @@ -170,13 +167,12 @@ func StartWebhookServer(ctx context.Context, enableWebhookClientCertVerification
log.Debugf("webhook config: %v", cfg)
}
featureGateCsiMigrationEnabled = containerOrchestratorUtility.IsFSSEnabled(ctx, common.CSIMigration)
featureGateBlockVolumeSnapshotEnabled = containerOrchestratorUtility.IsFSSEnabled(ctx, common.BlockVolumeSnapshot)
featureGateTopologyAwareFileVolumeEnabled = containerOrchestratorUtility.IsFSSEnabled(ctx,
common.TopologyAwareFileVolume)
featureFileVolumesWithVmServiceEnabled = containerOrchestratorUtility.IsFSSEnabled(ctx,
common.FileVolumesWithVmService)

if featureGateCsiMigrationEnabled || featureGateBlockVolumeSnapshotEnabled {
if featureGateCsiMigrationEnabled {
certs, err := tls.LoadX509KeyPair(cfg.WebHookConfig.CertFile, cfg.WebHookConfig.KeyFile)
if err != nil {
log.Errorf("failed to load key pair. certFile: %q, keyFile: %q err: %v",
Expand Down
6 changes: 2 additions & 4 deletions pkg/syncer/admissionhandler/cnscsi_admissionhandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,10 +188,8 @@ func (h *CSISupervisorWebhook) Handle(ctx context.Context, req admission.Request
if !resp.Allowed {
return
}
if featureGateBlockVolumeSnapshotEnabled {
admissionResp := validatePVC(ctx, &req.AdmissionRequest)
resp.AdmissionResponse = *admissionResp.DeepCopy()
}
admissionResp := validatePVC(ctx, &req.AdmissionRequest)
resp.AdmissionResponse = *admissionResp.DeepCopy()
} else if req.Kind.Kind == "CnsFileAccessConfig" {
if featureFileVolumesWithVmServiceEnabled {
switch req.Operation {
Expand Down
Loading