From 2bbe8dbe535f915dd97229291d8f2de62a297169 Mon Sep 17 00:00:00 2001 From: Andrew Lavery Date: Wed, 20 Dec 2023 19:00:49 +0000 Subject: [PATCH] remove pointer calls --- pkg/migrate/migrate_test.go | 4 ++-- pkg/preflight/validate_test.go | 38 +++++++++++++++++----------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/pkg/migrate/migrate_test.go b/pkg/migrate/migrate_test.go index cc1a0e0..0e94205 100644 --- a/pkg/migrate/migrate_test.go +++ b/pkg/migrate/migrate_test.go @@ -17,7 +17,7 @@ import ( "k8s.io/apimachinery/pkg/runtime" k8sclient "k8s.io/client-go/kubernetes" "k8s.io/client-go/kubernetes/fake" - "k8s.io/utils/pointer" + "k8s.io/utils/ptr" ) type testWriter struct { @@ -859,7 +859,7 @@ func TestGetPVCs(t *testing.T) { }, Spec: corev1.PersistentVolumeClaimSpec{ VolumeName: "pv2", - StorageClassName: pointer.String("sc1"), + StorageClassName: ptr.To("sc1"), }, }, }, diff --git a/pkg/preflight/validate_test.go b/pkg/preflight/validate_test.go index 54ed9b6..2728fbb 100644 --- a/pkg/preflight/validate_test.go +++ b/pkg/preflight/validate_test.go @@ -15,7 +15,7 @@ import ( "k8s.io/apimachinery/pkg/runtime" k8sclient "k8s.io/client-go/kubernetes" "k8s.io/client-go/kubernetes/fake" - "k8s.io/utils/pointer" + "k8s.io/utils/ptr" ) func Test_validateVolumeAccessModes(t *testing.T) { @@ -39,7 +39,7 @@ func Test_validateVolumeAccessModes(t *testing.T) { Namespace: "default", }, Spec: corev1.PersistentVolumeClaimSpec{ - StorageClassName: pointer.String("default"), + StorageClassName: ptr.To("default"), AccessModes: []corev1.PersistentVolumeAccessMode{"ReadWriteMany"}, Resources: corev1.VolumeResourceRequirements{ Requests: corev1.ResourceList{ @@ -54,7 +54,7 @@ func Test_validateVolumeAccessModes(t *testing.T) { Namespace: "default", }, Spec: corev1.PersistentVolumeClaimSpec{ - StorageClassName: pointer.String("default"), + StorageClassName: ptr.To("default"), AccessModes: []corev1.PersistentVolumeAccessMode{"ReadWriteMany"}, Resources: corev1.VolumeResourceRequirements{ Requests: corev1.ResourceList{ @@ -329,7 +329,7 @@ func Test_checkVolumeAccessModes(t *testing.T) { UID: "12345", }, Spec: corev1.PersistentVolumeClaimSpec{ - StorageClassName: pointer.String("srcSc"), + StorageClassName: ptr.To("srcSc"), AccessModes: []corev1.PersistentVolumeAccessMode{"ReadWriteMany"}, }, Status: corev1.PersistentVolumeClaimStatus{Phase: corev1.ClaimPending}, @@ -375,7 +375,7 @@ func Test_checkVolumeAccessModes(t *testing.T) { UID: "12345", }, Spec: corev1.PersistentVolumeClaimSpec{ - StorageClassName: pointer.String("dstSc"), + StorageClassName: ptr.To("dstSc"), AccessModes: []corev1.PersistentVolumeAccessMode{"ReadWriteMany"}, }, Status: corev1.PersistentVolumeClaimStatus{Phase: corev1.ClaimPending}, @@ -464,7 +464,7 @@ func Test_buildTmpPVC(t *testing.T) { Namespace: "default", }, Spec: corev1.PersistentVolumeClaimSpec{ - StorageClassName: pointer.String("dstSc"), + StorageClassName: ptr.To("dstSc"), AccessModes: []corev1.PersistentVolumeAccessMode{"ReadWriteOnce"}, }, }, @@ -474,7 +474,7 @@ func Test_buildTmpPVC(t *testing.T) { Namespace: "default", }, Spec: corev1.PersistentVolumeClaimSpec{ - StorageClassName: pointer.String("dstSc"), + StorageClassName: ptr.To("dstSc"), AccessModes: []corev1.PersistentVolumeAccessMode{"ReadWriteOnce"}, Resources: corev1.VolumeResourceRequirements{ Requests: corev1.ResourceList{ @@ -496,7 +496,7 @@ func Test_buildTmpPVC(t *testing.T) { }, }, Spec: corev1.PersistentVolumeClaimSpec{ - StorageClassName: pointer.String("dstSc"), + StorageClassName: ptr.To("dstSc"), AccessModes: []corev1.PersistentVolumeAccessMode{"ReadWriteOnce"}, }, }, @@ -506,7 +506,7 @@ func Test_buildTmpPVC(t *testing.T) { Namespace: "default", }, Spec: corev1.PersistentVolumeClaimSpec{ - StorageClassName: pointer.String("dstSc"), + StorageClassName: ptr.To("dstSc"), AccessModes: []corev1.PersistentVolumeAccessMode{"ReadWriteMany"}, Resources: corev1.VolumeResourceRequirements{ Requests: corev1.ResourceList{ @@ -617,7 +617,7 @@ func Test_pvcsForStorageClass(t *testing.T) { Namespace: "default", }, Spec: corev1.PersistentVolumeClaimSpec{ - StorageClassName: pointer.String("default"), + StorageClassName: ptr.To("default"), AccessModes: []corev1.PersistentVolumeAccessMode{"ReadWriteOnce"}, Resources: corev1.VolumeResourceRequirements{ Requests: corev1.ResourceList{ @@ -680,7 +680,7 @@ func Test_pvcsForStorageClass(t *testing.T) { Namespace: "default", }, Spec: corev1.PersistentVolumeClaimSpec{ - StorageClassName: pointer.String("default"), + StorageClassName: ptr.To("default"), AccessModes: []corev1.PersistentVolumeAccessMode{"ReadWriteOnce"}, Resources: corev1.VolumeResourceRequirements{ Requests: corev1.ResourceList{ @@ -695,7 +695,7 @@ func Test_pvcsForStorageClass(t *testing.T) { Namespace: "test", }, Spec: corev1.PersistentVolumeClaimSpec{ - StorageClassName: pointer.String("default"), + StorageClassName: ptr.To("default"), AccessModes: []corev1.PersistentVolumeAccessMode{"ReadWriteOnce"}, Resources: corev1.VolumeResourceRequirements{ Requests: corev1.ResourceList{ @@ -710,7 +710,7 @@ func Test_pvcsForStorageClass(t *testing.T) { Namespace: "test", }, Spec: corev1.PersistentVolumeClaimSpec{ - StorageClassName: pointer.String("rook"), + StorageClassName: ptr.To("rook"), AccessModes: []corev1.PersistentVolumeAccessMode{"ReadWriteMany"}, Resources: corev1.VolumeResourceRequirements{ Requests: corev1.ResourceList{ @@ -732,7 +732,7 @@ func Test_pvcsForStorageClass(t *testing.T) { Namespace: "default", }, Spec: corev1.PersistentVolumeClaimSpec{ - StorageClassName: pointer.String("default"), + StorageClassName: ptr.To("default"), AccessModes: []corev1.PersistentVolumeAccessMode{"ReadWriteOnce"}, Resources: corev1.VolumeResourceRequirements{ Requests: corev1.ResourceList{ @@ -747,7 +747,7 @@ func Test_pvcsForStorageClass(t *testing.T) { Namespace: "test", }, Spec: corev1.PersistentVolumeClaimSpec{ - StorageClassName: pointer.String("default"), + StorageClassName: ptr.To("default"), AccessModes: []corev1.PersistentVolumeAccessMode{"ReadWriteOnce"}, Resources: corev1.VolumeResourceRequirements{ Requests: corev1.ResourceList{ @@ -793,7 +793,7 @@ func Test_pvcsForStorageClass(t *testing.T) { Namespace: "default", }, Spec: corev1.PersistentVolumeClaimSpec{ - StorageClassName: pointer.String("default"), + StorageClassName: ptr.To("default"), AccessModes: []corev1.PersistentVolumeAccessMode{"ReadWriteOnce"}, Resources: corev1.VolumeResourceRequirements{ Requests: corev1.ResourceList{ @@ -808,7 +808,7 @@ func Test_pvcsForStorageClass(t *testing.T) { Namespace: "test", }, Spec: corev1.PersistentVolumeClaimSpec{ - StorageClassName: pointer.String("default"), + StorageClassName: ptr.To("default"), AccessModes: []corev1.PersistentVolumeAccessMode{"ReadWriteOnce"}, Resources: corev1.VolumeResourceRequirements{ Requests: corev1.ResourceList{ @@ -862,7 +862,7 @@ func Test_pvcsForStorageClass(t *testing.T) { Namespace: "default", }, Spec: corev1.PersistentVolumeClaimSpec{ - StorageClassName: pointer.String("default"), + StorageClassName: ptr.To("default"), AccessModes: []corev1.PersistentVolumeAccessMode{"ReadWriteOnce"}, Resources: corev1.VolumeResourceRequirements{ Requests: corev1.ResourceList{ @@ -877,7 +877,7 @@ func Test_pvcsForStorageClass(t *testing.T) { Namespace: "test", }, Spec: corev1.PersistentVolumeClaimSpec{ - StorageClassName: pointer.String("rook"), + StorageClassName: ptr.To("rook"), AccessModes: []corev1.PersistentVolumeAccessMode{"ReadWriteMany"}, Resources: corev1.VolumeResourceRequirements{ Requests: corev1.ResourceList{