Skip to content

Commit 7aeaea3

Browse files
committed
Switch to modern k8s.io/utils/ptr util
1 parent a2934f7 commit 7aeaea3

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

vertical-pod-autoscaler/e2e/utils/webhook.go

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import (
3737
clientset "k8s.io/client-go/kubernetes"
3838
"k8s.io/kubernetes/test/e2e/framework"
3939
e2edeploy "k8s.io/kubernetes/test/e2e/framework/deployment"
40-
"k8s.io/utils/pointer"
40+
"k8s.io/utils/ptr"
4141
)
4242

4343
const (
@@ -49,8 +49,6 @@ const (
4949
deploymentName = "sample-webhook-deployment"
5050
)
5151

52-
func strPtr(s string) *string { return &s }
53-
5452
// LabelNamespace applies unique label to the namespace.
5553
func LabelNamespace(f *framework.Framework, namespace string) {
5654
client := f.ClientSet
@@ -107,8 +105,8 @@ func RegisterMutatingWebhookForPod(f *framework.Framework, configName string, ce
107105
Service: &admissionregistrationv1.ServiceReference{
108106
Namespace: namespace,
109107
Name: WebhookServiceName,
110-
Path: strPtr("/mutating-pods-sidecar"),
111-
Port: pointer.Int32Ptr(servicePort),
108+
Path: ptr.To("/mutating-pods-sidecar"),
109+
Port: ptr.To(servicePort),
112110
},
113111
CABundle: certContext.signingCert,
114112
},
@@ -167,8 +165,8 @@ func newMutatingIsReadyWebhookFixture(f *framework.Framework, certContext *certC
167165
Service: &admissionregistrationv1.ServiceReference{
168166
Namespace: f.Namespace.Name,
169167
Name: WebhookServiceName,
170-
Path: strPtr("/always-deny"),
171-
Port: pointer.Int32Ptr(servicePort),
168+
Path: ptr.To("/always-deny"),
169+
Port: ptr.To(servicePort),
172170
},
173171
CABundle: certContext.signingCert,
174172
},

vertical-pod-autoscaler/e2e/v1/actuation.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
"time"
2323

2424
"k8s.io/autoscaler/vertical-pod-autoscaler/pkg/utils/test"
25-
"k8s.io/utils/pointer"
25+
"k8s.io/utils/ptr"
2626

2727
appsv1 "k8s.io/api/apps/v1"
2828
autoscaling "k8s.io/api/autoscaling/v1"
@@ -884,7 +884,7 @@ func testEvictsSingletonPodWhenConfigured(f *framework.Framework, controller *au
884884
WithName("hamster-vpa").
885885
WithNamespace(f.Namespace.Name).
886886
WithTargetRef(controller).
887-
WithMinReplicas(pointer.Int32(1)).
887+
WithMinReplicas(ptr.To(int32(1))).
888888
WithContainer(containerName).
889889
AppendRecommendation(
890890
test.Recommendation().

0 commit comments

Comments
 (0)