Skip to content

Commit

Permalink
Fix linter issue with "k8s.io/utils/pointer" package usage
Browse files Browse the repository at this point in the history
"k8s.io/utils/pointer" is deprecated and instead functions in "k8s.io/utils/ptr" are
used instead: to be specific, ptr.To to obtain a pointer in this case

Signed-off-by: Furkat Gofurov <[email protected]>
  • Loading branch information
furkatgofurov7 committed Dec 21, 2023
1 parent 47d738f commit b55d33c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions internal/sync/core.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
kerrors "k8s.io/apimachinery/pkg/util/errors"
"k8s.io/utils/pointer"
"k8s.io/utils/ptr"
"sigs.k8s.io/controller-runtime/pkg/client"
"sigs.k8s.io/controller-runtime/pkg/log"

Expand Down Expand Up @@ -66,7 +66,7 @@ func setOwnerReference(owner, obj client.Object) {
Kind: turtlesv1.Kind,
Name: owner.GetName(),
UID: owner.GetUID(),
Controller: pointer.Bool(true),
BlockOwnerDeletion: pointer.Bool(true),
Controller: ptr.To(true),
BlockOwnerDeletion: ptr.To(true),
}})
}
4 changes: 2 additions & 2 deletions internal/sync/provider_sync_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
turtlesv1 "github.com/rancher-sandbox/rancher-turtles/api/v1alpha1"
"github.com/rancher-sandbox/rancher-turtles/internal/sync"
corev1 "k8s.io/api/core/v1"
"k8s.io/utils/pointer"
"k8s.io/utils/ptr"
. "sigs.k8s.io/controller-runtime/pkg/envtest/komega"

metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
Expand Down Expand Up @@ -67,7 +67,7 @@ var _ = Describe("Provider sync", func() {
Eventually(UpdateStatus(infrastructure, func() {
infrastructure.Status = operatorv1.InfrastructureProviderStatus{
ProviderStatus: operatorv1.ProviderStatus{
InstalledVersion: pointer.String("v1.2.3"),
InstalledVersion: ptr.To("v1.2.3"),
},
}
})).Should(Succeed())
Expand Down

0 comments on commit b55d33c

Please sign in to comment.