Skip to content

Commit 4df5cf4

Browse files
committed
Address comments
1 parent ce9801b commit 4df5cf4

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

pkg/services/vmoperator/vmopmachine.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ import (
4747
)
4848

4949
const (
50-
csiEncryptionClassAnnotationKey = "csi.vsphere.encryption-class"
50+
csiVolumeRequestedTopologyAnnotationKey = "csi.vsphere.volume-requested-topology"
51+
csiEncryptionClassAnnotationKey = "csi.vsphere.encryption-class"
5152
)
5253

5354
// VmopMachineService reconciles VM Operator VM.
@@ -763,7 +764,7 @@ func (v *VmopMachineService) addVolumes(ctx context.Context, supervisorMachineCt
763764
if err != nil {
764765
return errors.Errorf("failed to marshal zone topology %q: %s", *zone, err)
765766
}
766-
annotations["csi.vsphere.volume-requested-topology"] = string(b)
767+
annotations[csiVolumeRequestedTopologyAnnotationKey] = string(b)
767768
}
768769

769770
if encryptionClassName != "" {

test/framework/vmoperator/vmoperator.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ const (
8282
// Additional key we are adding to the VcCredsSecret for sake of convenience (not supported in vm-operator).
8383

8484
thumbprintSecretKey = "CAPV-TEST-Thumbprint" //nolint:gosec
85+
86+
defaultEncryptionClassLabel = "encryption.vmware.com/default"
8587
)
8688

8789
// ReconcileDependencies reconciles dependencies for the vm-operator.
@@ -469,7 +471,7 @@ func ReconcileDependencies(ctx context.Context, c client.Client, dependenciesCon
469471
// Add default label if this is the default EncryptionClass
470472
if ec.Default {
471473
metadata["labels"] = map[string]interface{}{
472-
"encryption.vmware.com/default": "true",
474+
defaultEncryptionClassLabel: "true",
473475
}
474476
}
475477

@@ -498,11 +500,11 @@ func ReconcileDependencies(ctx context.Context, c client.Client, dependenciesCon
498500
Namespace: config.Namespace,
499501
}, existing); err != nil {
500502
if !apierrors.IsNotFound(err) {
501-
retryError = errors.Wrapf(err, "failed to get EncryptionClass %s", ec.Name)
503+
retryError = errors.Wrapf(err, "failed to get EncryptionClass %s/%s", config.Namespace, ec.Name)
502504
return false, nil
503505
}
504506
if err := c.Create(ctx, encryptionClass); err != nil {
505-
retryError = errors.Wrapf(err, "failed to create EncryptionClass %s", ec.Name)
507+
retryError = errors.Wrapf(err, "failed to create EncryptionClass %s/%s", config.Namespace, ec.Name)
506508
return false, nil
507509
}
508510
log.Info("Created EncryptionClass", "EncryptionClass", klog.KRef(config.Namespace, ec.Name))

0 commit comments

Comments
 (0)