Skip to content

Commit 81280e3

Browse files
Remove all references to WCP_VMService_BYOK FSS
Signed-off-by: Nikolay Andreev <[email protected]>
1 parent fff2b83 commit 81280e3

File tree

11 files changed

+51
-76
lines changed

11 files changed

+51
-76
lines changed

cmd/syncer/main.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -378,8 +378,7 @@ func initSyncerComponents(ctx context.Context, clusterFlavor cnstypes.CnsCluster
378378
}
379379
}()
380380

381-
if clusterFlavor == cnstypes.CnsClusterFlavorWorkload &&
382-
commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx, common.WCP_VMService_BYOK) {
381+
if clusterFlavor == cnstypes.CnsClusterFlavorWorkload {
383382
// Start BYOK Operator for Supervisor clusters.
384383
go func() {
385384
defer func() {

manifests/supervisorcluster/1.28/cns-csi.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -505,7 +505,6 @@ data:
505505
"vdpp-on-stretched-supervisor": "true"
506506
"cns-unregister-volume": "false"
507507
"workload-domain-isolation": "false"
508-
"WCP_VMService_BYOK": "true"
509508
kind: ConfigMap
510509
metadata:
511510
name: csi-feature-states

manifests/supervisorcluster/1.29/cns-csi.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,6 @@ data:
563563
"vdpp-on-stretched-supervisor": "true"
564564
"cns-unregister-volume": "false"
565565
"workload-domain-isolation": "false"
566-
"WCP_VMService_BYOK": "true"
567566
"file-volume-with-vm-service": "false"
568567
"csi-transaction-support": "false"
569568
"linked-clone-support": "false"

manifests/supervisorcluster/1.30/cns-csi.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,6 @@ data:
567567
"vdpp-on-stretched-supervisor": "true"
568568
"cns-unregister-volume": "false"
569569
"workload-domain-isolation": "false"
570-
"WCP_VMService_BYOK": "true"
571570
"sv-pvc-snapshot-protection-finalizer": "false"
572571
"file-volume-with-vm-service": "false"
573572
"csi-transaction-support": "false"

manifests/supervisorcluster/1.31/cns-csi.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,6 @@ data:
567567
"vdpp-on-stretched-supervisor": "true"
568568
"cns-unregister-volume": "false"
569569
"workload-domain-isolation": "false"
570-
"WCP_VMService_BYOK": "true"
571570
"sv-pvc-snapshot-protection-finalizer": "false"
572571
"file-volume-with-vm-service": "false"
573572
"csi-transaction-support": "false"

manifests/supervisorcluster/1.32/cns-csi.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -566,7 +566,6 @@ data:
566566
"vdpp-on-stretched-supervisor": "true"
567567
"cns-unregister-volume": "false"
568568
"workload-domain-isolation": "false"
569-
"WCP_VMService_BYOK": "true"
570569
"sv-pvc-snapshot-protection-finalizer": "false"
571570
"file-volume-with-vm-service": "false"
572571
"linked-clone-support": "false"

pkg/csi/service/common/constants.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -440,8 +440,6 @@ const (
440440
MultipleClustersPerVsphereZone = "supports_multiple_clusters_per_zone"
441441
// VPCCapabilitySupervisor is a supervisor capability indicating if VPC FSS is enabled
442442
VPCCapabilitySupervisor = "VPC_Supported"
443-
// WCP_VMService_BYOK_FSS enables Bring Your Own Key (BYOK) capabilities.
444-
WCP_VMService_BYOK = "WCP_VMService_BYOK"
445443
// SVPVCSnapshotProtectionFinalizer is FSS that controls add/remove
446444
// CNS finalizer on supervisor PVC/Snapshots from PVCSI
447445
SVPVCSnapshotProtectionFinalizer = "sv-pvc-snapshot-protection-finalizer"

pkg/csi/service/common/vsphereutil.go

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@ type CreateBlockVolumeOptions struct {
5858
FilterSuspendedDatastores,
5959
UseSupervisorId,
6060
IsVdppOnStretchedSvFssEnabled bool
61-
IsByokEnabled bool
6261
IsCSITransactionSupportEnabled bool
6362
VolFromSnapshotOnTargetDs bool
6463
}
@@ -371,31 +370,28 @@ func CreateBlockVolumeUtil(
371370
log.Infof("VolFromSnapshotOnTargetDs is enabled, skip the compatible datastore check")
372371
}
373372
}
374-
if opts.IsByokEnabled {
375-
// Retrieve the encryption key ID from the source volume
376-
snapshotVolumeCryptoKeyID, err = QueryVolumeCryptoKeyByID(ctx, manager.VolumeManager, cnsVolumeID)
377-
if err != nil {
378-
return nil, csifault.CSIInternalFault, logger.LogNewErrorf(log,
379-
"failed to query volume crypto key for the snapshot %s with error %+v",
380-
spec.ContentSourceSnapshotID, err)
381-
}
373+
374+
// Retrieve the encryption key ID from the source volume
375+
snapshotVolumeCryptoKeyID, err = QueryVolumeCryptoKeyByID(ctx, manager.VolumeManager, cnsVolumeID)
376+
if err != nil {
377+
return nil, csifault.CSIInternalFault, logger.LogNewErrorf(log,
378+
"failed to query volume crypto key for the snapshot %s with error %+v",
379+
spec.ContentSourceSnapshotID, err)
382380
}
383381
}
384382

385-
if opts.IsByokEnabled {
386-
// Build crypto spec for the new volume.
387-
var cryptoKeyID *vim25types.CryptoKeyId
388-
if spec.CryptoKeyID != nil {
389-
cryptoKeyID = &vim25types.CryptoKeyId{
390-
KeyId: spec.CryptoKeyID.KeyID,
391-
ProviderId: &vim25types.KeyProviderId{Id: spec.CryptoKeyID.KeyProvider},
392-
}
383+
// Build crypto spec for the new volume.
384+
var cryptoKeyID *vim25types.CryptoKeyId
385+
if spec.CryptoKeyID != nil {
386+
cryptoKeyID = &vim25types.CryptoKeyId{
387+
KeyId: spec.CryptoKeyID.KeyID,
388+
ProviderId: &vim25types.KeyProviderId{Id: spec.CryptoKeyID.KeyProvider},
393389
}
390+
}
394391

395-
cryptoSpec := createCryptoSpec(snapshotVolumeCryptoKeyID, cryptoKeyID)
396-
if cryptoSpec != nil {
397-
createSpec.CreateSpec = &cnstypes.CnsBlockCreateSpec{CryptoSpec: cryptoSpec}
398-
}
392+
cryptoSpec := createCryptoSpec(snapshotVolumeCryptoKeyID, cryptoKeyID)
393+
if cryptoSpec != nil {
394+
createSpec.CreateSpec = &cnstypes.CnsBlockCreateSpec{CryptoSpec: cryptoSpec}
399395
}
400396

401397
log.Debugf("vSphere CSI driver creating volume %s with create spec %+v", spec.Name, spew.Sdump(createSpec))

pkg/csi/service/wcp/controller.go

Lines changed: 13 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -179,13 +179,9 @@ func (c *controller) Init(config *cnsconfig.Config, version string) error {
179179
return logger.LogNewErrorf(log, "failed to create an instance of volume manager. err=%v", err)
180180
}
181181

182-
var cryptoClient crypto.Client
183-
184-
if commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx, common.WCP_VMService_BYOK) {
185-
var err error
186-
if cryptoClient, err = crypto.NewClientWithDefaultConfig(ctx); err != nil {
187-
return logger.LogNewErrorf(log, "failed to create an instance of crypto client. err=%v", err)
188-
}
182+
cryptoClient, err := crypto.NewClientWithDefaultConfig(ctx)
183+
if err != nil {
184+
return logger.LogNewErrorf(log, "failed to create an instance of crypto client. err=%v", err)
189185
}
190186

191187
c.manager = &common.Manager{
@@ -770,20 +766,17 @@ func (c *controller) createBlockVolume(ctx context.Context, req *csi.CreateVolum
770766
}
771767

772768
var cryptoKeyID *common.CryptoKeyID
773-
isByokEnabled := commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx, common.WCP_VMService_BYOK)
774-
if isByokEnabled {
775-
if encClass, err := c.manager.CryptoClient.GetEncryptionClassForPVC(
776-
ctx,
777-
pvcName,
778-
pvcNamespace); err != nil {
769+
if encClass, err := c.manager.CryptoClient.GetEncryptionClassForPVC(
770+
ctx,
771+
pvcName,
772+
pvcNamespace); err != nil {
779773

780-
return nil, csifault.CSIInternalFault, logger.LogNewErrorCodef(log, codes.Internal,
781-
"failed to get encryption class for PVC. Error: %+v", err)
782-
} else if encClass != nil {
783-
cryptoKeyID = &common.CryptoKeyID{
784-
KeyID: encClass.Spec.KeyID,
785-
KeyProvider: encClass.Spec.KeyProvider,
786-
}
774+
return nil, csifault.CSIInternalFault, logger.LogNewErrorCodef(log, codes.Internal,
775+
"failed to get encryption class for PVC. Error: %+v", err)
776+
} else if encClass != nil {
777+
cryptoKeyID = &common.CryptoKeyID{
778+
KeyID: encClass.Spec.KeyID,
779+
KeyProvider: encClass.Spec.KeyProvider,
787780
}
788781
}
789782

@@ -807,7 +800,6 @@ func (c *controller) createBlockVolume(ctx context.Context, req *csi.CreateVolum
807800
FilterSuspendedDatastores: filterSuspendedDatastores,
808801
UseSupervisorId: isTKGSHAEnabled,
809802
IsVdppOnStretchedSvFssEnabled: isVdppOnStretchedSVEnabled,
810-
IsByokEnabled: isByokEnabled,
811803
IsCSITransactionSupportEnabled: isCSITransactionSupportEnabled,
812804
VolFromSnapshotOnTargetDs: volFromSnapshotOnTargetDs,
813805
}

pkg/syncer/admissionhandler/admissionhandler.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ var (
5959
featureGateBlockVolumeSnapshotEnabled bool
6060
featureGateTKGSHaEnabled bool
6161
featureGateTopologyAwareFileVolumeEnabled bool
62-
featureGateByokEnabled bool
6362
featureFileVolumesWithVmServiceEnabled bool
6463
featureIsSharedDiskEnabled bool
6564
featureIsLinkedCloneSupportEnabled bool
@@ -146,7 +145,6 @@ func StartWebhookServer(ctx context.Context, enableWebhookClientCertVerification
146145
if clusterFlavor == cnstypes.CnsClusterFlavorWorkload {
147146
featureGateTKGSHaEnabled = containerOrchestratorUtility.IsFSSEnabled(ctx, common.TKGsHA)
148147
featureGateBlockVolumeSnapshotEnabled = containerOrchestratorUtility.IsFSSEnabled(ctx, common.BlockVolumeSnapshot)
149-
featureGateByokEnabled = containerOrchestratorUtility.IsFSSEnabled(ctx, common.WCP_VMService_BYOK)
150148
featureIsSharedDiskEnabled = containerOrchestratorUtility.IsFSSEnabled(ctx, common.SharedDiskFss)
151149
featureFileVolumesWithVmServiceEnabled = containerOrchestratorUtility.IsFSSEnabled(ctx,
152150
common.FileVolumesWithVmService)

0 commit comments

Comments
 (0)