Skip to content

Commit 0201ccd

Browse files
authored
Change Diskmode to the correct independent_persistent value (#3480)
1 parent b888c22 commit 0201ccd

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

pkg/apis/cnsoperator/cnsnodevmbatchattachment/v1alpha1/cnsnodebatchvmattachment_types.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ import (
2424
type DiskMode string
2525

2626
const (
27-
// By setting DiskMode to IndependentPersistent, a virtual machine's disk is not captured in snapshots and
27+
// By setting DiskMode to independent_persistent, a virtual machine's disk is not captured in snapshots and
2828
// changes are permanently written to the disk, regardless of snapshot operations.
29-
IndependentPersistent DiskMode = "IndependentPersistent"
29+
IndependentPersistent DiskMode = "independent_persistent"
3030
// Changes are immediately and permanently written to the virtual disk.
31-
Persistent DiskMode = "Persistent"
31+
Persistent DiskMode = "persistent"
3232
)
3333

3434
// The sharing mode of the virtual disk.

pkg/syncer/cnsoperator/controller/cnsnodevmbatchattachment/cnsnodevmbatchattachment_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -398,21 +398,21 @@ func TestValidateBatchAttachRequestWithRwxPvc(t *testing.T) {
398398
t.Run("TestValidateBatchAttachRequestWithRwxPvc", func(t *testing.T) {
399399

400400
batchAttachRequest := volumes.BatchAttachRequest{
401-
DiskMode: "Persistent",
401+
DiskMode: "persistent",
402402
ControllerKey: "12345",
403403
UnitNumber: "9",
404404
}
405405

406406
commonco.ContainerOrchestratorUtility = &unittestcommon.FakeK8SOrchestrator{}
407407
err := validateBatchAttachRequest(context.TODO(), batchAttachRequest, testNamespace, "pvc-rwx")
408408
expectedErr := fmt.Errorf("incorrect input for PVC pvc-rwx in namespace test-ns with accessMode ReadWriteMany. " +
409-
"DiskMode cannot be Persistent")
409+
"DiskMode cannot be persistent")
410410
assert.EqualError(t, expectedErr, err.Error())
411411

412412
batchAttachRequest = volumes.BatchAttachRequest{
413413
ControllerKey: "",
414414
UnitNumber: "12",
415-
DiskMode: "IndependentPersistent",
415+
DiskMode: "independent_persistent",
416416
}
417417

418418
commonco.ContainerOrchestratorUtility = &unittestcommon.FakeK8SOrchestrator{}

0 commit comments

Comments
 (0)