Skip to content

Commit 8df648e

Browse files
authored
use supports_FCD_transaction wcp capability to enabled transaction support (#3509)
1 parent 5881dad commit 8df648e

File tree

9 files changed

+22
-16
lines changed

9 files changed

+22
-16
lines changed

manifests/supervisorcluster/1.29/cns-csi.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -574,7 +574,6 @@ data:
574574
"workload-domain-isolation": "false"
575575
"sv-pvc-snapshot-protection-finalizer": "false"
576576
"file-volume-with-vm-service": "false"
577-
"csi-transaction-support": "false"
578577
kind: ConfigMap
579578
metadata:
580579
name: csi-feature-states

manifests/supervisorcluster/1.30/cns-csi.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,6 @@ data:
573573
"workload-domain-isolation": "false"
574574
"sv-pvc-snapshot-protection-finalizer": "false"
575575
"file-volume-with-vm-service": "false"
576-
"csi-transaction-support": "false"
577576
kind: ConfigMap
578577
metadata:
579578
name: csi-feature-states

manifests/supervisorcluster/1.31/cns-csi.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -573,7 +573,6 @@ data:
573573
"workload-domain-isolation": "false"
574574
"sv-pvc-snapshot-protection-finalizer": "false"
575575
"file-volume-with-vm-service": "false"
576-
"csi-transaction-support": "false"
577576
kind: ConfigMap
578577
metadata:
579578
name: csi-feature-states

manifests/supervisorcluster/1.32/cns-csi.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -576,7 +576,6 @@ data:
576576
"workload-domain-isolation": "false"
577577
"sv-pvc-snapshot-protection-finalizer": "false"
578578
"file-volume-with-vm-service": "false"
579-
"csi-transaction-support": "false"
580579
kind: ConfigMap
581580
metadata:
582581
name: csi-feature-states

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1102,6 +1102,7 @@ func (c *K8sOrchestrator) HandleLateEnablementOfCapability(ctx context.Context,
11021102
clusterFlavor cnstypes.CnsClusterFlavor, capability,
11031103
gcPort, gcEndpoint string) {
11041104
log := logger.GetLogger(ctx)
1105+
log.Infof("Starting a routine to handle late enablement for capability: %q", capability)
11051106
var restClientConfig *restclient.Config
11061107
var err error
11071108

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1874,6 +1874,10 @@ func (c *K8sOrchestrator) GetActiveClustersForNamespaceInRequestedZones(ctx cont
18741874
}
18751875
activeClusters = append(activeClusters, clusters...)
18761876
}
1877+
if len(activeClusters) == 0 {
1878+
return nil, logger.LogNewErrorf(log, "could not find active cluster for the namespace %q "+
1879+
"in requested zones: %v", targetNS, requestedZones)
1880+
}
18771881
log.Infof("active clusters: %v for namespace: %q in requested zones: %v", activeClusters, targetNS, requestedZones)
18781882
return activeClusters, nil
18791883
}

pkg/csi/service/common/constants.go

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -444,8 +444,10 @@ const (
444444
FileVolumesWithVmService = "file-volume-with-vm-service"
445445
// SharedDiskFss is an FSS that tells whether shared disks are supported or not
446446
SharedDiskFss = "supports_shared_disks_with_VM_service_VMs"
447-
// CSITranSactionSupport is an FSS for transaction support
448-
CSITranSactionSupport = "csi-transaction-support"
447+
// FCDTransactionSupport is the wcp capability that tells whether transaction is supported in CSI
448+
FCDTransactionSupport = "supports_FCD_transaction"
449+
// CSITransactionSupport is an FSS for transaction support
450+
CSITransactionSupport = "csi-transaction-support"
449451
// VolFromSnapshotOnTargetDs is a FSS that tells whether creation of volumes from
450452
// snapshots on different datastores feature is supported in CSI.
451453
VolFromSnapshotOnTargetDs = "supports_vol_from_snapshot_on_target_ds"
@@ -472,17 +474,20 @@ var WCPFeatureStates = map[string]struct{}{
472474
StoragePolicyReservationSupport: {},
473475
WCPVMServiceVMSnapshots: {},
474476
BYOKEncryption: {},
477+
FCDTransactionSupport: {},
478+
MultipleClustersPerVsphereZone: {},
475479
}
476480

477481
// WCPFeatureStatesSupportsLateEnablement contains capabilities that can be enabled later
478482
// after CSI upgrade
479483
// During FSS check if driver detects that the capabilities is disabled in the cached configmap,
480484
// it will re-fetch the configmap and update the cached configmap.
481485
var WCPFeatureStatesSupportsLateEnablement = map[string]struct{}{
482-
WorkloadDomainIsolation: {},
483-
LinkedCloneSupport: {},
484-
WCPVMServiceVMSnapshots: {},
485-
BYOKEncryption: {},
486+
WorkloadDomainIsolation: {},
487+
LinkedCloneSupport: {},
488+
MultipleClustersPerVsphereZone: {},
489+
WCPVMServiceVMSnapshots: {},
490+
BYOKEncryption: {},
486491
}
487492

488493
// WCPFeatureAssociatedWithPVCSI contains FSS name used in PVCSI and associated WCP Capability name on a

pkg/csi/service/vanilla/controller.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ func (c *controller) Init(config *cnsconfig.Config, version string) error {
136136
common.CnsMgrSuspendCreateVolume)
137137
isTopologyAwareFileVolumeEnabled = commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx,
138138
common.TopologyAwareFileVolume)
139-
isCSITransactionSupportEnabled = commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx, common.CSITranSactionSupport)
139+
isCSITransactionSupportEnabled = commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx, common.CSITransactionSupport)
140140

141141
vcManager := cnsvsphere.GetVirtualCenterManager(ctx)
142142
if !multivCenterCSITopologyEnabled {

pkg/csi/service/wcp/controller.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -529,7 +529,7 @@ func (c *controller) createBlockVolume(ctx context.Context, req *csi.CreateVolum
529529
topologyRequirement = req.GetAccessibilityRequirements()
530530
filterSuspendedDatastores := commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx, common.CnsMgrSuspendCreateVolume)
531531
isTKGSHAEnabled := commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx, common.TKGsHA)
532-
isCSITransactionSupportEnabled := commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx, common.CSITranSactionSupport)
532+
isFCDTransactionSupportEnabled := commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx, common.FCDTransactionSupport)
533533

534534
topoSegToDatastoresMap := make(map[string][]*cnsvsphere.DatastoreInfo)
535535
if isTKGSHAEnabled {
@@ -840,7 +840,7 @@ func (c *controller) createBlockVolume(ctx context.Context, req *csi.CreateVolum
840840
FilterSuspendedDatastores: filterSuspendedDatastores,
841841
UseSupervisorId: isTKGSHAEnabled,
842842
IsByokEnabled: isByokEnabled,
843-
IsCSITransactionSupportEnabled: isCSITransactionSupportEnabled,
843+
IsCSITransactionSupportEnabled: isFCDTransactionSupportEnabled,
844844
VolFromSnapshotOnTargetDs: volFromSnapshotOnTargetDs,
845845
}
846846

@@ -2440,8 +2440,8 @@ func (c *controller) CreateSnapshot(ctx context.Context, req *csi.CreateSnapshot
24402440
var cnsVolumeInfo *cnsvolumeinfov1alpha1.CNSVolumeInfo
24412441
isStorageQuotaM2FSSEnabled := commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx,
24422442
common.StorageQuotaM2)
2443-
isCSITransactionSupportEnabled := commonco.ContainerOrchestratorUtility.
2444-
IsFSSEnabled(ctx, common.CSITranSactionSupport)
2443+
isFCDTransactionSupportEnabled := commonco.ContainerOrchestratorUtility.
2444+
IsFSSEnabled(ctx, common.FCDTransactionSupport)
24452445
if isStorageQuotaM2FSSEnabled {
24462446
cnsVolumeInfo, err = volumeInfoService.GetVolumeInfoForVolumeID(ctx, volumeID)
24472447
if err != nil {
@@ -2455,7 +2455,7 @@ func (c *controller) CreateSnapshot(ctx context.Context, req *csi.CreateSnapshot
24552455
Namespace: cnsVolumeInfo.Spec.Namespace,
24562456
Capacity: cnsVolumeInfo.Spec.Capacity,
24572457
IsStorageQuotaM2FSSEnabled: isStorageQuotaM2FSSEnabled,
2458-
IsCSITransactionSupportEnabled: isCSITransactionSupportEnabled,
2458+
IsCSITransactionSupportEnabled: isFCDTransactionSupportEnabled,
24592459
})
24602460
if err != nil {
24612461
return nil, logger.LogNewErrorCodef(log, codes.Internal,

0 commit comments

Comments
 (0)