From 38f759e39bd26161f14a95307309542ec6211e2f Mon Sep 17 00:00:00 2001 From: "syself-bot[bot]" <115953087+syself-bot[bot]@users.noreply.github.com> Date: Tue, 26 Sep 2023 22:57:53 +0000 Subject: [PATCH] :seedling: update caph builder image to 1.0.9 golangci-lint fixes this uses generics to fix all the type references. It removes occurences of deprecated pointer package and use k8s.io/utils/ptr instead. --- .builder-image-version.txt | 2 +- .github/workflows/main-promote-builder-image.yml | 2 +- .github/workflows/pr-lint.yml | 2 +- .github/workflows/schedule-scan-image.yml | 2 +- controllers/hcloudmachine_controller_test.go | 8 ++++---- .../hetznerbaremetalhost_controller_test.go | 8 ++++---- .../hetznerbaremetalmachine_controller_test.go | 10 +++++----- controllers/hetznercluster_controller_test.go | 4 ++-- images/builder/Dockerfile | 14 +++++++------- pkg/services/baremetal/baremetal/baremetal.go | 6 +++--- .../baremetal/baremetal/baremetal_test.go | 8 ++++---- pkg/services/baremetal/host/host_test.go | 16 ++++++++-------- pkg/services/hcloud/client/client.go | 3 ++- pkg/services/hcloud/server/server_test.go | 4 ++-- pkg/utils/utils_test.go | 10 +++++----- 15 files changed, 50 insertions(+), 49 deletions(-) diff --git a/.builder-image-version.txt b/.builder-image-version.txt index b0f3d96f8..66c4c2263 100644 --- a/.builder-image-version.txt +++ b/.builder-image-version.txt @@ -1 +1 @@ -1.0.8 +1.0.9 diff --git a/.github/workflows/main-promote-builder-image.yml b/.github/workflows/main-promote-builder-image.yml index 49de3aaaa..1dbaf5447 100644 --- a/.github/workflows/main-promote-builder-image.yml +++ b/.github/workflows/main-promote-builder-image.yml @@ -10,7 +10,7 @@ jobs: name: Promote Latest tag to Caph Builder Image runs-on: ubuntu-latest container: - image: ghcr.io/syself/caph-builder:1.0.8 + image: ghcr.io/syself/caph-builder:1.0.9 credentials: username: ${{ github.actor }} password: ${{ secrets.github_token }} diff --git a/.github/workflows/pr-lint.yml b/.github/workflows/pr-lint.yml index 20a9eae4e..db01ee5eb 100644 --- a/.github/workflows/pr-lint.yml +++ b/.github/workflows/pr-lint.yml @@ -14,7 +14,7 @@ jobs: if: github.event_name != 'pull_request_target' || !github.event.pull_request.draft runs-on: ubuntu-latest container: - image: ghcr.io/syself/caph-builder:1.0.8 + image: ghcr.io/syself/caph-builder:1.0.9 credentials: username: ${{ github.actor }} password: ${{ secrets.github_token }} diff --git a/.github/workflows/schedule-scan-image.yml b/.github/workflows/schedule-scan-image.yml index f308825d3..f2f6ff341 100644 --- a/.github/workflows/schedule-scan-image.yml +++ b/.github/workflows/schedule-scan-image.yml @@ -9,7 +9,7 @@ jobs: name: Trivy runs-on: ubuntu-latest container: - image: ghcr.io/syself/caph-builder:1.0.8 + image: ghcr.io/syself/caph-builder:1.0.9 credentials: username: ${{ github.actor }} password: ${{ secrets.github_token }} diff --git a/controllers/hcloudmachine_controller_test.go b/controllers/hcloudmachine_controller_test.go index 4d879a950..77515d053 100644 --- a/controllers/hcloudmachine_controller_test.go +++ b/controllers/hcloudmachine_controller_test.go @@ -25,7 +25,7 @@ import ( corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/klog/v2" - "k8s.io/utils/pointer" + "k8s.io/utils/ptr" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/cluster-api/util/patch" @@ -98,7 +98,7 @@ var _ = Describe("HCloudMachineReconciler", func() { }, FailureDomain: &defaultFailureDomain, Bootstrap: clusterv1.Bootstrap{ - DataSecretName: pointer.String("bootstrap-secret"), + DataSecretName: ptr.To("bootstrap-secret"), }, }, } @@ -207,7 +207,7 @@ var _ = Describe("HCloudMachineReconciler", func() { Expect(err).ShouldNot(HaveOccurred()) capiMachine.Spec.Bootstrap = clusterv1.Bootstrap{ - DataSecretName: pointer.String("bootstrap-secret"), + DataSecretName: ptr.To("bootstrap-secret"), } Eventually(func() error { @@ -463,7 +463,7 @@ var _ = Describe("Hetzner secret", func() { }, FailureDomain: &defaultFailureDomain, Bootstrap: clusterv1.Bootstrap{ - DataSecretName: pointer.String("bootstrap-secret"), + DataSecretName: ptr.To("bootstrap-secret"), }, }, } diff --git a/controllers/hetznerbaremetalhost_controller_test.go b/controllers/hetznerbaremetalhost_controller_test.go index 47348ffbf..71883e762 100644 --- a/controllers/hetznerbaremetalhost_controller_test.go +++ b/controllers/hetznerbaremetalhost_controller_test.go @@ -27,7 +27,7 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/types" - "k8s.io/utils/pointer" + "k8s.io/utils/ptr" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util/patch" "sigs.k8s.io/controller-runtime/pkg/client" @@ -264,7 +264,7 @@ var _ = Describe("HetznerBareMetalHostReconciler", func() { }, FailureDomain: &defaultFailureDomain, Bootstrap: clusterv1.Bootstrap{ - DataSecretName: pointer.String("bootstrap-secret"), + DataSecretName: ptr.To("bootstrap-secret"), }, }, } @@ -461,7 +461,7 @@ var _ = Describe("HetznerBareMetalHostReconciler", func() { }, FailureDomain: &defaultFailureDomain, Bootstrap: clusterv1.Bootstrap{ - DataSecretName: pointer.String("bootstrap-secret"), + DataSecretName: ptr.To("bootstrap-secret"), }, }, } @@ -609,7 +609,7 @@ var _ = Describe("HetznerBareMetalHostReconciler - missing secrets", func() { }, FailureDomain: &defaultFailureDomain, Bootstrap: clusterv1.Bootstrap{ - DataSecretName: pointer.String("bootstrap-secret"), + DataSecretName: ptr.To("bootstrap-secret"), }, }, } diff --git a/controllers/hetznerbaremetalmachine_controller_test.go b/controllers/hetznerbaremetalmachine_controller_test.go index 12c69695e..a0107bf45 100644 --- a/controllers/hetznerbaremetalmachine_controller_test.go +++ b/controllers/hetznerbaremetalmachine_controller_test.go @@ -27,7 +27,7 @@ import ( apierrors "k8s.io/apimachinery/pkg/api/errors" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/selection" - "k8s.io/utils/pointer" + "k8s.io/utils/ptr" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util/patch" "sigs.k8s.io/controller-runtime/pkg/client" @@ -258,7 +258,7 @@ var _ = Describe("HetznerBareMetalMachineReconciler", func() { Expect(err).ShouldNot(HaveOccurred()) capiMachine.Spec.Bootstrap = clusterv1.Bootstrap{ - DataSecretName: pointer.String("bootstrap-secret"), + DataSecretName: ptr.To("bootstrap-secret"), } Eventually(func() error { return ph.Patch(ctx, capiMachine, patch.WithStatusObservedGeneration{}) @@ -292,7 +292,7 @@ var _ = Describe("HetznerBareMetalMachineReconciler", func() { }, FailureDomain: &defaultFailureDomain, Bootstrap: clusterv1.Bootstrap{ - DataSecretName: pointer.String("bootstrap-secret"), + DataSecretName: ptr.To("bootstrap-secret"), }, }, } @@ -457,7 +457,7 @@ var _ = Describe("HetznerBareMetalMachineReconciler", func() { }, FailureDomain: &defaultFailureDomain, Bootstrap: clusterv1.Bootstrap{ - DataSecretName: pointer.String("bootstrap-secret"), + DataSecretName: ptr.To("bootstrap-secret"), }, }, } @@ -515,7 +515,7 @@ var _ = Describe("HetznerBareMetalMachineReconciler", func() { }, FailureDomain: &defaultFailureDomain, Bootstrap: clusterv1.Bootstrap{ - DataSecretName: pointer.String("bootstrap-secret"), + DataSecretName: ptr.To("bootstrap-secret"), }, }, } diff --git a/controllers/hetznercluster_controller_test.go b/controllers/hetznercluster_controller_test.go index 9c0f78352..9f3f53c34 100644 --- a/controllers/hetznercluster_controller_test.go +++ b/controllers/hetznercluster_controller_test.go @@ -25,7 +25,7 @@ import ( . "github.com/onsi/gomega" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/utils/pointer" + "k8s.io/utils/ptr" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/cluster-api/util/patch" @@ -614,7 +614,7 @@ func createCapiAndHcloudMachines(ctx context.Context, env *helpers.TestEnvironme }, FailureDomain: &defaultFailureDomain, Bootstrap: clusterv1.Bootstrap{ - DataSecretName: pointer.String("bootstrap-secret"), + DataSecretName: ptr.To("bootstrap-secret"), }, }, } diff --git a/images/builder/Dockerfile b/images/builder/Dockerfile index 202c99102..92fe60a6c 100644 --- a/images/builder/Dockerfile +++ b/images/builder/Dockerfile @@ -17,9 +17,9 @@ # If you make changes to this Dockerfile run `make builder-image-push`. # Install Lychee -FROM docker.io/library/alpine:3.17.3@sha256:b6ca290b6b4cdcca5b3db3ffa338ee0285c11744b4a6abaa9627746ee3291d8d as lychee +FROM docker.io/library/alpine:3.18.3@sha256:c5c5fda71656f28e49ac9c5416b3643eaa6a108a8093151d6d1afc9463be8e33 as lychee # update: datasource=github-tags depName=lycheeverse/lychee versioning=semver -ENV LYCHEE_VERSION="v0.11.1" +ENV LYCHEE_VERSION="v0.13.0" # hadolint ignore=DL3018 RUN apk add --no-cache curl && \ curl -L -o /tmp/lychee-${LYCHEE_VERSION}.tgz https://github.com/lycheeverse/lychee/releases/download/${LYCHEE_VERSION}/lychee-${LYCHEE_VERSION}-x86_64-unknown-linux-gnu.tar.gz && \ @@ -28,9 +28,9 @@ RUN apk add --no-cache curl && \ rm -rf /tmp/linux-amd64 /tmp/lychee-${LYCHEE_VERSION}.tgz # Install Golang CI Lint -FROM docker.io/library/alpine:3.17.3@sha256:b6ca290b6b4cdcca5b3db3ffa338ee0285c11744b4a6abaa9627746ee3291d8d as golangci +FROM docker.io/library/alpine:3.18.3@sha256:c5c5fda71656f28e49ac9c5416b3643eaa6a108a8093151d6d1afc9463be8e33 as golangci # update: datasource=github-tags depName=golangci/golangci-lint versioning=semver -ENV GOLANGCI_VERSION="v1.52.2" +ENV GOLANGCI_VERSION="v1.54.2" WORKDIR / # hadolint ignore=DL3018,DL4006 RUN apk add --no-cache curl && \ @@ -40,17 +40,17 @@ RUN apk add --no-cache curl && \ FROM docker.io/hadolint/hadolint:v2.12.0-alpine@sha256:7dba9a9f1a0350f6d021fb2f6f88900998a4fb0aaf8e4330aa8c38544f04db42 as hadolint # Install Trivy -FROM docker.io/aquasec/trivy:0.39.0@sha256:ab281f43ee11b8ea5443ca8897641441f04f14e8832fefd103d32b4acd7055e1 as trivy +FROM docker.io/aquasec/trivy:0.45.1@sha256:88ee0d68a0265099d36895b9fef4de0415f7a7b6ea6cc23038e23eba93780960 as trivy ############################ # Caph Build Image Base # ############################ -FROM docker.io/library/golang:1.21.1-bullseye@sha256:357be9f9e594a338ba16f54c4df16481e7e82533a6571cecaf22dca833622f91 +FROM docker.io/library/golang:1.21.1-bullseye@sha256:4f23be7ef78eedf4ec41661a92ef73f53f722f57194adddf7d9b40699753c776 # update: datasource=repology depName=debian_11/skopeo versioning=loose ENV SKOPEO_VERSION="1.2.2+dfsg1-1+b6" # update: datasource=github-tags depName=adrienverge/yamllint versioning=semver -ENV YAMLLINT_VERSION="v1.30.0" +ENV YAMLLINT_VERSION="v1.32.0" # update: datasource=github-tags depName=opt-nc/yamlfixer versioning=semver ENV YAMLFIXER_VERSION="0.9.15" diff --git a/pkg/services/baremetal/baremetal/baremetal.go b/pkg/services/baremetal/baremetal/baremetal.go index 8e3206c0d..51ffc32d8 100644 --- a/pkg/services/baremetal/baremetal/baremetal.go +++ b/pkg/services/baremetal/baremetal/baremetal.go @@ -35,7 +35,7 @@ import ( metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" "k8s.io/apimachinery/pkg/labels" "k8s.io/apimachinery/pkg/selection" - "k8s.io/utils/pointer" + "k8s.io/utils/ptr" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" capierrors "sigs.k8s.io/cluster-api/errors" "sigs.k8s.io/cluster-api/util/conditions" @@ -635,13 +635,13 @@ func setOwnerRefInList(refList []metav1.OwnerReference, objType metav1.TypeMeta, Kind: objType.Kind, Name: objMeta.Name, UID: objMeta.UID, - Controller: pointer.Bool(isController), + Controller: ptr.To(isController), }) } else { // update existing owner ref because the UID and the APIVersion might change due to move or version upgrade refList[index].APIVersion = objType.APIVersion refList[index].UID = objMeta.UID - refList[index].Controller = pointer.Bool(isController) + refList[index].Controller = ptr.To(isController) } return refList } diff --git a/pkg/services/baremetal/baremetal/baremetal_test.go b/pkg/services/baremetal/baremetal/baremetal_test.go index 7cfe42976..5288e612d 100644 --- a/pkg/services/baremetal/baremetal/baremetal_test.go +++ b/pkg/services/baremetal/baremetal/baremetal_test.go @@ -31,7 +31,7 @@ import ( "k8s.io/apimachinery/pkg/runtime/schema" "k8s.io/apimachinery/pkg/selection" utilruntime "k8s.io/apimachinery/pkg/util/runtime" - "k8s.io/utils/pointer" + "k8s.io/utils/ptr" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/controller-runtime/pkg/client" fakeclient "sigs.k8s.io/controller-runtime/pkg/client/fake" @@ -454,7 +454,7 @@ var _ = Describe("Test setOwnerRefInList", func() { Name: "bm-machine", Kind: "HetznerBareMetalMachine", APIVersion: "v1beta1", - Controller: pointer.Bool(true), + Controller: ptr.To(true), }, }, }), @@ -471,7 +471,7 @@ var _ = Describe("Test setOwnerRefInList", func() { Name: "bm-machine", Kind: "HetznerBareMetalMachine", APIVersion: "v1beta1", - Controller: pointer.Bool(true), + Controller: ptr.To(true), }, }, }), @@ -503,7 +503,7 @@ var _ = Describe("Test setOwnerRefInList", func() { Name: "bm-machine", Kind: "HetznerBareMetalMachine", APIVersion: "v1beta1", - Controller: pointer.Bool(true), + Controller: ptr.To(true), }, }, }), diff --git a/pkg/services/baremetal/host/host_test.go b/pkg/services/baremetal/host/host_test.go index dfe188473..ce75c4e73 100644 --- a/pkg/services/baremetal/host/host_test.go +++ b/pkg/services/baremetal/host/host_test.go @@ -25,7 +25,7 @@ import ( "github.com/stretchr/testify/mock" "github.com/syself/hrobot-go/models" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/utils/pointer" + "k8s.io/utils/ptr" infrav1 "github.com/syself/cluster-api-provider-hetzner/api/v1beta1" bmmock "github.com/syself/cluster-api-provider-hetzner/pkg/services/baremetal/client/mocks" @@ -183,7 +183,7 @@ NAME="nvme1n1" TYPE="disk" HCTL="" MODEL="SAMSUNG MZVLB512HAJQ-00000" VENDOR="" NAME="nvme2n1" TYPE="disk" HCTL="" MODEL="SAMSUNG MZVL22T0HBLB-00B00" VENDOR="" SERIAL="S677NF0R402742" SIZE="2048408248320" WWN="eui.002538b411b2cee8" ROTA="0" NAME="nvme1n1" TYPE="disk" HCTL="" MODEL="SAMSUNG MZVLB512HAJQ-00000" VENDOR="" SERIAL="S3W8NX0N811178" SIZE="512110190592" WWN="eui.0025388801b4dff2" ROTA="0"`, expectedOutput: nil, - expectedErrorMessage: pointer.String("unknown rota"), + expectedErrorMessage: ptr.To("unknown rota"), }), ) }) @@ -986,7 +986,7 @@ var _ = Describe("analyzeSSHOutputProvisioned", func() { out: sshclient.Output{StdOut: "wrong_hostname"}, expectedIsTimeout: false, expectedIsConnectionRefused: false, - expectedErrMessage: pointer.String("unexpected hostname"), + expectedErrMessage: ptr.To("unexpected hostname"), }), Entry("timeout error", testCaseAnalyzeSSHOutputProvisioned{ out: sshclient.Output{Err: timeout}, @@ -998,19 +998,19 @@ var _ = Describe("analyzeSSHOutputProvisioned", func() { out: sshclient.Output{StdErr: "some error"}, expectedIsTimeout: false, expectedIsConnectionRefused: false, - expectedErrMessage: pointer.String("failed to get hostname via ssh: StdErr: some error"), + expectedErrMessage: ptr.To("failed to get hostname via ssh: StdErr: some error"), }), Entry("incorrect boot - empty hostname", testCaseAnalyzeSSHOutputProvisioned{ out: sshclient.Output{StdOut: ""}, expectedIsTimeout: false, expectedIsConnectionRefused: false, - expectedErrMessage: pointer.String("hostname is empty"), + expectedErrMessage: ptr.To("hostname is empty"), }), Entry("unable to authenticate", testCaseAnalyzeSSHOutputProvisioned{ out: sshclient.Output{Err: sshclient.ErrAuthenticationFailed}, expectedIsTimeout: false, expectedIsConnectionRefused: false, - expectedErrMessage: pointer.String("wrong ssh key"), + expectedErrMessage: ptr.To("wrong ssh key"), }), Entry("connection refused", testCaseAnalyzeSSHOutputProvisioned{ out: sshclient.Output{Err: sshclient.ErrConnectionRefused}, @@ -1108,7 +1108,7 @@ var _ = Describe("actionRegistering", func() { includeRootDeviceHintWWN: true, includeRootDeviceHintRaid: false, expectedActionResult: actionFailed{}, - expectedErrorMessage: pointer.String("missing storage device for root device hint eui.002538b411b2cee8"), + expectedErrorMessage: ptr.To("missing storage device for root device hint eui.002538b411b2cee8"), }), Entry("no root device hints", testCaseActionRegistering{ storageStdOut: `NAME="loop0" LABEL="" FSTYPE="ext2" TYPE="loop" HCTL="" MODEL="" VENDOR="" SERIAL="" SIZE="3068773888" WWN="" ROTA="0" @@ -1117,7 +1117,7 @@ var _ = Describe("actionRegistering", func() { includeRootDeviceHintWWN: false, includeRootDeviceHintRaid: false, expectedActionResult: actionFailed{}, - expectedErrorMessage: pointer.String(infrav1.ErrorMessageMissingRootDeviceHints), + expectedErrorMessage: ptr.To(infrav1.ErrorMessageMissingRootDeviceHints), }), ) diff --git a/pkg/services/hcloud/client/client.go b/pkg/services/hcloud/client/client.go index 423086578..e58489dc5 100644 --- a/pkg/services/hcloud/client/client.go +++ b/pkg/services/hcloud/client/client.go @@ -25,8 +25,9 @@ import ( "github.com/hetznercloud/hcloud-go/v2/hcloud" "github.com/prometheus/client_golang/prometheus" - caphversion "github.com/syself/cluster-api-provider-hetzner/pkg/version" "sigs.k8s.io/controller-runtime/pkg/metrics" + + caphversion "github.com/syself/cluster-api-provider-hetzner/pkg/version" ) const errStringUnauthorized = "(unauthorized)" diff --git a/pkg/services/hcloud/server/server_test.go b/pkg/services/hcloud/server/server_test.go index 6dd4c1ca3..d7e2fc333 100644 --- a/pkg/services/hcloud/server/server_test.go +++ b/pkg/services/hcloud/server/server_test.go @@ -24,7 +24,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/utils/pointer" + "k8s.io/utils/ptr" clusterv1 "sigs.k8s.io/cluster-api/api/v1beta1" "sigs.k8s.io/cluster-api/util/conditions" "sigs.k8s.io/controller-runtime/pkg/reconcile" @@ -281,7 +281,7 @@ var _ = Describe("handleServerStatusOff", func() { Expect(res).Should(Equal(emptyResult)) Expect(server.Status).To(Equal(hcloud.ServerStatusOff)) - Expect(hcloudMachine.Status.FailureMessage).Should(Equal(pointer.String("reached timeout of waiting for machines that are switched off"))) + Expect(hcloudMachine.Status.FailureMessage).Should(Equal(ptr.To("reached timeout of waiting for machines that are switched off"))) }) It("tries to power on server and sets new condition if different one is set", func() { diff --git a/pkg/utils/utils_test.go b/pkg/utils/utils_test.go index 0e2cb0a90..0e09f4f87 100644 --- a/pkg/utils/utils_test.go +++ b/pkg/utils/utils_test.go @@ -20,7 +20,7 @@ import ( . "github.com/onsi/ginkgo/v2" . "github.com/onsi/gomega" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/utils/pointer" + "k8s.io/utils/ptr" "github.com/syself/cluster-api-provider-hetzner/pkg/utils" ) @@ -295,7 +295,7 @@ var _ = Describe("Test FindOwnerRefFromList", func() { APIVersion: "v1beta1", }, }, - ExpectedPosition: pointer.Int(0), + ExpectedPosition: ptr.To(0), }), Entry("Matching consumer position 1", testCaseFindOwnerRefFromList{ RefList: []metav1.OwnerReference{ @@ -310,7 +310,7 @@ var _ = Describe("Test FindOwnerRefFromList", func() { APIVersion: "v1beta1", }, }, - ExpectedPosition: pointer.Int(1), + ExpectedPosition: ptr.To(1), }), Entry("Matching consumer position 1a", testCaseFindOwnerRefFromList{ RefList: []metav1.OwnerReference{ @@ -325,7 +325,7 @@ var _ = Describe("Test FindOwnerRefFromList", func() { APIVersion: "v1beta1", }, }, - ExpectedPosition: pointer.Int(1), + ExpectedPosition: ptr.To(1), }), Entry("Matching consumer position 1b", testCaseFindOwnerRefFromList{ RefList: []metav1.OwnerReference{ @@ -340,7 +340,7 @@ var _ = Describe("Test FindOwnerRefFromList", func() { APIVersion: "v1beta1", }, }, - ExpectedPosition: pointer.Int(1), + ExpectedPosition: ptr.To(1), }), ) })