Skip to content

Commit 0e0f274

Browse files
committed
pkg/volume: drop pointer wrapper functions.
The new k8s.io/utils/ptr package provides generic wrapper functions, which can be used instead of type-specific pointer wrapper functions. This replaces the latter with the former, and migrates other uses of the deprecated pointer package to ptr in affacted files. See kubernetes/utils#283 for details. Signed-off-by: Lan Liang <[email protected]>
1 parent cae35db commit 0e0f274

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

pkg/volume/csi/nodeinfomanager/nodeinfomanager_test.go

+5-5
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ import (
4141
"k8s.io/kubernetes/pkg/apis/core/helper"
4242
volumetest "k8s.io/kubernetes/pkg/volume/testing"
4343
"k8s.io/kubernetes/pkg/volume/util"
44-
utilpointer "k8s.io/utils/pointer"
44+
ptr "k8s.io/utils/ptr"
4545
)
4646

4747
type testcase struct {
@@ -459,7 +459,7 @@ func TestInstallCSIDriver(t *testing.T) {
459459
NodeID: "com.example.csi/csi-node1",
460460
TopologyKeys: nil,
461461
Allocatable: &storage.VolumeNodeResources{
462-
Count: utilpointer.Int32Ptr(10),
462+
Count: ptr.To[int32](10),
463463
},
464464
},
465465
},
@@ -488,7 +488,7 @@ func TestInstallCSIDriver(t *testing.T) {
488488
NodeID: "com.example.csi/csi-node1",
489489
TopologyKeys: nil,
490490
Allocatable: &storage.VolumeNodeResources{
491-
Count: utilpointer.Int32Ptr(math.MaxInt32),
491+
Count: ptr.To[int32](math.MaxInt32),
492492
},
493493
},
494494
},
@@ -517,7 +517,7 @@ func TestInstallCSIDriver(t *testing.T) {
517517
NodeID: "com.example.csi/csi-node1",
518518
TopologyKeys: nil,
519519
Allocatable: &storage.VolumeNodeResources{
520-
Count: utilpointer.Int32Ptr(math.MaxInt32),
520+
Count: ptr.To[int32](math.MaxInt32),
521521
},
522522
},
523523
},
@@ -606,7 +606,7 @@ func TestInstallCSIDriver(t *testing.T) {
606606

607607
func generateVolumeLimits(i int32) *storage.VolumeNodeResources {
608608
return &storage.VolumeNodeResources{
609-
Count: utilpointer.Int32Ptr(i),
609+
Count: ptr.To[int32](i),
610610
}
611611
}
612612

0 commit comments

Comments
 (0)