Skip to content

Commit c0508f5

Browse files
committed
use k8s.io/utils/ptr instead of the deprecated pointer pkg
1 parent b7a9ced commit c0508f5

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

pkg/operator/status_test.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import (
88
appsapi "k8s.io/api/apps/v1"
99
corev1 "k8s.io/api/core/v1"
1010
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
11-
"k8s.io/utils/pointer"
11+
"k8s.io/utils/ptr"
1212

1313
imageregistryv1 "github.com/openshift/api/imageregistry/v1"
1414
operatorv1 "github.com/openshift/api/operator/v1"
@@ -69,7 +69,7 @@ func Test_syncStatus(t *testing.T) {
6969
Generation: 8,
7070
},
7171
Spec: appsapi.DeploymentSpec{
72-
Replicas: pointer.Int32(3),
72+
Replicas: ptr.To[int32](3),
7373
},
7474
Status: appsapi.DeploymentStatus{
7575
Replicas: 3,
@@ -119,7 +119,7 @@ func Test_syncStatus(t *testing.T) {
119119
Generation: 8,
120120
},
121121
Spec: appsapi.DeploymentSpec{
122-
Replicas: pointer.Int32(3),
122+
Replicas: ptr.To[int32](3),
123123
},
124124
Status: appsapi.DeploymentStatus{
125125
Replicas: 3,
@@ -206,7 +206,7 @@ func Test_syncStatus(t *testing.T) {
206206
},
207207
deploy: &appsapi.Deployment{
208208
Spec: appsapi.DeploymentSpec{
209-
Replicas: pointer.Int32(3),
209+
Replicas: ptr.To[int32](3),
210210
},
211211
Status: appsapi.DeploymentStatus{
212212
AvailableReplicas: 2,
@@ -250,7 +250,7 @@ func Test_syncStatus(t *testing.T) {
250250
},
251251
deploy: &appsapi.Deployment{
252252
Spec: appsapi.DeploymentSpec{
253-
Replicas: pointer.Int32(3),
253+
Replicas: ptr.To[int32](3),
254254
},
255255
Status: appsapi.DeploymentStatus{
256256
AvailableReplicas: 2,
@@ -301,7 +301,7 @@ func Test_syncStatus(t *testing.T) {
301301
},
302302
deploy: &appsapi.Deployment{
303303
Spec: appsapi.DeploymentSpec{
304-
Replicas: pointer.Int32(3),
304+
Replicas: ptr.To[int32](3),
305305
},
306306
Status: appsapi.DeploymentStatus{
307307
AvailableReplicas: 2,
@@ -717,7 +717,7 @@ func Test_syncStatus(t *testing.T) {
717717
Generation: 8,
718718
},
719719
Spec: appsapi.DeploymentSpec{
720-
Replicas: pointer.Int32(3),
720+
Replicas: ptr.To[int32](3),
721721
},
722722
Status: appsapi.DeploymentStatus{
723723
Replicas: 3,

pkg/resource/deployment.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414
coreset "k8s.io/client-go/kubernetes/typed/core/v1"
1515
appslisters "k8s.io/client-go/listers/apps/v1"
1616
corelisters "k8s.io/client-go/listers/core/v1"
17-
"k8s.io/utils/pointer"
17+
"k8s.io/utils/ptr"
1818

1919
imageregistryv1 "github.com/openshift/api/imageregistry/v1"
2020
operatorv1 "github.com/openshift/api/operator/v1"
@@ -143,7 +143,7 @@ func (gd *generatorDeployment) expected() (runtime.Object, error) {
143143
},
144144
},
145145
Spec: appsapi.DeploymentSpec{
146-
ProgressDeadlineSeconds: pointer.Int32(60),
146+
ProgressDeadlineSeconds: ptr.To[int32](60),
147147
Replicas: &gd.cr.Spec.Replicas,
148148
Selector: &metav1.LabelSelector{
149149
MatchLabels: defaults.DeploymentLabels,

0 commit comments

Comments
 (0)