Skip to content

Commit 8066399

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

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
kind: ConfigMap

manifests/supervisorcluster/1.30/cns-csi.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,6 @@ data:
569569
"vdpp-on-stretched-supervisor": "true"
570570
"cns-unregister-volume": "false"
571571
"workload-domain-isolation": "false"
572-
"WCP_VMService_BYOK": "true"
573572
"sv-pvc-snapshot-protection-finalizer": "false"
574573
"file-volume-with-vm-service": "false"
575574
"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
@@ -569,7 +569,6 @@ data:
569569
"vdpp-on-stretched-supervisor": "true"
570570
"cns-unregister-volume": "false"
571571
"workload-domain-isolation": "false"
572-
"WCP_VMService_BYOK": "true"
573572
"sv-pvc-snapshot-protection-finalizer": "false"
574573
"file-volume-with-vm-service": "false"
575574
"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
@@ -569,7 +569,6 @@ data:
569569
"vdpp-on-stretched-supervisor": "true"
570570
"cns-unregister-volume": "false"
571571
"workload-domain-isolation": "false"
572-
"WCP_VMService_BYOK": "true"
573572
"sv-pvc-snapshot-protection-finalizer": "false"
574573
"file-volume-with-vm-service": "false"
575574
"storage-policy-reservation-support": "false"

pkg/csi/service/common/constants.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -437,8 +437,6 @@ const (
437437
MultipleClustersPerVsphereZone = "supports_multiple_clusters_per_zone"
438438
// VPCCapabilitySupervisor is a supervisor capability indicating if VPC FSS is enabled
439439
VPCCapabilitySupervisor = "VPC_Supported"
440-
// WCP_VMService_BYOK_FSS enables Bring Your Own Key (BYOK) capabilities.
441-
WCP_VMService_BYOK = "WCP_VMService_BYOK"
442440
// SVPVCSnapshotProtectionFinalizer is FSS that controls add/remove
443441
// CNS finalizer on supervisor PVC/Snapshots from PVCSI
444442
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{
@@ -805,20 +801,17 @@ func (c *controller) createBlockVolume(ctx context.Context, req *csi.CreateVolum
805801
}
806802

807803
var cryptoKeyID *common.CryptoKeyID
808-
isByokEnabled := commonco.ContainerOrchestratorUtility.IsFSSEnabled(ctx, common.WCP_VMService_BYOK)
809-
if isByokEnabled {
810-
if encClass, err := c.manager.CryptoClient.GetEncryptionClassForPVC(
811-
ctx,
812-
pvcName,
813-
pvcNamespace); err != nil {
804+
if encClass, err := c.manager.CryptoClient.GetEncryptionClassForPVC(
805+
ctx,
806+
pvcName,
807+
pvcNamespace); err != nil {
814808

815-
return nil, csifault.CSIInternalFault, logger.LogNewErrorCodef(log, codes.Internal,
816-
"failed to get encryption class for PVC. Error: %+v", err)
817-
} else if encClass != nil {
818-
cryptoKeyID = &common.CryptoKeyID{
819-
KeyID: encClass.Spec.KeyID,
820-
KeyProvider: encClass.Spec.KeyProvider,
821-
}
809+
return nil, csifault.CSIInternalFault, logger.LogNewErrorCodef(log, codes.Internal,
810+
"failed to get encryption class for PVC. Error: %+v", err)
811+
} else if encClass != nil {
812+
cryptoKeyID = &common.CryptoKeyID{
813+
KeyID: encClass.Spec.KeyID,
814+
KeyProvider: encClass.Spec.KeyProvider,
822815
}
823816
}
824817

@@ -842,7 +835,6 @@ func (c *controller) createBlockVolume(ctx context.Context, req *csi.CreateVolum
842835
FilterSuspendedDatastores: filterSuspendedDatastores,
843836
UseSupervisorId: isTKGSHAEnabled,
844837
IsVdppOnStretchedSvFssEnabled: isVdppOnStretchedSVEnabled,
845-
IsByokEnabled: isByokEnabled,
846838
IsCSITransactionSupportEnabled: isCSITransactionSupportEnabled,
847839
VolFromSnapshotOnTargetDs: volFromSnapshotOnTargetDs,
848840
}

pkg/syncer/admissionhandler/admissionhandler.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,6 @@ var (
6161
featureGateBlockVolumeSnapshotEnabled bool
6262
featureGateTKGSHaEnabled bool
6363
featureGateTopologyAwareFileVolumeEnabled bool
64-
featureGateByokEnabled bool
6564
featureFileVolumesWithVmServiceEnabled bool
6665
featureIsSharedDiskEnabled bool
6766
featureIsLinkedCloneSupportEnabled bool
@@ -148,7 +147,6 @@ func StartWebhookServer(ctx context.Context, enableWebhookClientCertVerification
148147
if clusterFlavor == cnstypes.CnsClusterFlavorWorkload {
149148
featureGateTKGSHaEnabled = containerOrchestratorUtility.IsFSSEnabled(ctx, common.TKGsHA)
150149
featureGateBlockVolumeSnapshotEnabled = containerOrchestratorUtility.IsFSSEnabled(ctx, common.BlockVolumeSnapshot)
151-
featureGateByokEnabled = containerOrchestratorUtility.IsFSSEnabled(ctx, common.WCP_VMService_BYOK)
152150
featureIsSharedDiskEnabled = containerOrchestratorUtility.IsFSSEnabled(ctx, common.SharedDiskFss)
153151
featureFileVolumesWithVmServiceEnabled = containerOrchestratorUtility.IsFSSEnabled(ctx,
154152
common.FileVolumesWithVmService)

0 commit comments

Comments
 (0)