Skip to content

Commit 5ef2d64

Browse files
authored
fix: change controllerKey and unitNumber to *int32 (#3880)
Signed-off-by: Saloni Kogta <saloni.kogta@broadcom.com>
1 parent 7b6d459 commit 5ef2d64

2 files changed

Lines changed: 12 additions & 10 deletions

File tree

cns/client_test.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1251,6 +1251,8 @@ func TestClient(t *testing.T) {
12511251
t.Logf("Volume detached successfully")
12521252

12531253
if run_shared_disk_tests_tests == "true" && isvSphereVersion91orAbove {
1254+
t.Logf("Running shared disk tests")
1255+
12541256
// Test AttachVolume API with multiwriter parameters
12551257
var cnsVolumeAttachSpecList []cnstypes.CnsVolumeAttachDetachSpec
12561258
cnsVolumeAttachSpec := cnstypes.CnsVolumeAttachDetachSpec{
@@ -1260,8 +1262,8 @@ func TestClient(t *testing.T) {
12601262
Vm: nodeVM.Reference(),
12611263
DiskMode: "independent_persistent",
12621264
Sharing: "sharingMultiWriter",
1263-
UnitNumber: 23,
1264-
ControllerKey: 1000,
1265+
UnitNumber: vim25types.NewInt32(23),
1266+
ControllerKey: vim25types.NewInt32(1002),
12651267
}
12661268

12671269
cnsVolumeAttachSpecList = append(cnsVolumeAttachSpecList, cnsVolumeAttachSpec)

cns/types/types.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -218,8 +218,8 @@ type CnsVolumeAttachDetachSpec struct {
218218
Vm types.ManagedObjectReference `xml:"vm" json:"vm"`
219219
DiskMode string `xml:"diskMode,omitempty" json:"diskMode"`
220220
Sharing string `xml:"sharing,omitempty" json:"sharing"`
221-
ControllerKey int64 `xml:"controllerKey,omitempty" json:"controllerKey"`
222-
UnitNumber int64 `xml:"unitNumber,omitempty" json:"unitNumber"`
221+
ControllerKey *int32 `xml:"controllerKey,omitempty" json:"controllerKey"`
222+
UnitNumber *int32 `xml:"unitNumber,omitempty" json:"unitNumber"`
223223
}
224224

225225
func init() {
@@ -480,12 +480,12 @@ func init() {
480480
// CnsKubernetesQueryFilter enables querying CNS volumes using Kubernetes metadata such as
481481
// namespaces, pod names, PVC names, and PV names.
482482
//
483-
// - Values in the PodNames, PvcNames, and PvNames lists are treated as OR conditions.
484-
// - Values in the Namespaces list are also treated as OR conditions.
485-
// - When PodNames, PvcNames, or PvNames are specified along with Namespaces,
486-
// the filter applies an AND condition — i.e., the pod, PVC must belong to the specified namespace.
487-
// - When only Namespaces are provided (without any pod, PVC names),
488-
// all volumes associated with those namespaces will be returned.
483+
// - Values in the PodNames, PvcNames, and PvNames lists are treated as OR conditions.
484+
// - Values in the Namespaces list are also treated as OR conditions.
485+
// - When PodNames, PvcNames, or PvNames are specified along with Namespaces,
486+
// the filter applies an AND condition — i.e., the pod, PVC must belong to the specified namespace.
487+
// - When only Namespaces are provided (without any pod, PVC names),
488+
// all volumes associated with those namespaces will be returned.
489489
//
490490
// This allows flexible volume queries such as:
491491
// - Listing all volumes in one or more namespaces.

0 commit comments

Comments
 (0)