@@ -31,6 +31,7 @@ import (
3131 "k8s.io/client-go/kubernetes/scheme"
3232 "k8s.io/client-go/rest"
3333 "k8s.io/client-go/tools/remotecommand"
34+ "k8s.io/utils/ptr"
3435 "sigs.k8s.io/controller-runtime/pkg/client/config"
3536)
3637
@@ -199,19 +200,19 @@ func (c *MetricsTestConfig) createCurlMetricsPod(ctx context.Context) {
199200 },
200201 Spec : corev1.PodSpec {
201202 ServiceAccountName : c .serviceAccount ,
202- TerminationGracePeriodSeconds : int64Ptr ( 0 ),
203+ TerminationGracePeriodSeconds : ptr . To ( int64 ( 0 ) ),
203204 Containers : []corev1.Container {
204205 {
205206 Name : "curl" ,
206207 Image : "curlimages/curl" ,
207208 Command : []string {"sh" , "-c" , "sleep 3600" },
208209 SecurityContext : & corev1.SecurityContext {
209- AllowPrivilegeEscalation : boolPtr (false ),
210+ AllowPrivilegeEscalation : ptr . To (false ),
210211 Capabilities : & corev1.Capabilities {
211212 Drop : []corev1.Capability {"ALL" },
212213 },
213- RunAsNonRoot : boolPtr (true ),
214- RunAsUser : int64Ptr ( 1000 ),
214+ RunAsNonRoot : ptr . To (true ),
215+ RunAsUser : ptr . To ( int64 ( 1000 ) ),
215216 SeccompProfile : & corev1.SeccompProfile {
216217 Type : corev1 .SeccompProfileTypeRuntimeDefault ,
217218 },
@@ -382,12 +383,3 @@ func getComponentNamespace(t *testing.T, kubeClient kubernetes.Interface, select
382383 }
383384 return namespace
384385}
385-
386- // Helpers for pointers
387- func boolPtr (b bool ) * bool {
388- return & b
389- }
390-
391- func int64Ptr (i int64 ) * int64 {
392- return & i
393- }
0 commit comments