From f26de73b4537b9ee5ddded153c5aff45233c6ee1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A1s=20J=C3=A1ky?= Date: Fri, 27 Oct 2023 11:00:04 +0200 Subject: [PATCH] chore: switch to k8s.io/utils/ptr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit from deprecated k8s.io/utils/pointer Signed-off-by: András Jáky --- pkg/apis/vault/v1alpha1/vault_types.go | 4 ++-- pkg/controller/vault/vault_controller.go | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/pkg/apis/vault/v1alpha1/vault_types.go b/pkg/apis/vault/v1alpha1/vault_types.go index 292fadcb..7cbcdaa7 100644 --- a/pkg/apis/vault/v1alpha1/vault_types.go +++ b/pkg/apis/vault/v1alpha1/vault_types.go @@ -31,7 +31,7 @@ import ( netv1 "k8s.io/api/networking/v1" extv1beta1 "k8s.io/apiextensions-apiserver/pkg/apis/apiextensions/v1beta1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" - "k8s.io/utils/pointer" + "k8s.io/utils/ptr" ctrl "sigs.k8s.io/controller-runtime" ) @@ -1037,7 +1037,7 @@ func (vault *Vault) AsOwnerReference() metav1.OwnerReference { Kind: vault.Kind, Name: vault.Name, UID: vault.UID, - Controller: pointer.Bool(true), + Controller: ptr.To(true), } } diff --git a/pkg/controller/vault/vault_controller.go b/pkg/controller/vault/vault_controller.go index bccbe35b..2978ae40 100644 --- a/pkg/controller/vault/vault_controller.go +++ b/pkg/controller/vault/vault_controller.go @@ -48,7 +48,7 @@ import ( "k8s.io/apimachinery/pkg/runtime" "k8s.io/apimachinery/pkg/types" "k8s.io/apimachinery/pkg/util/intstr" - "k8s.io/utils/pointer" + "k8s.io/utils/ptr" "sigs.k8s.io/controller-runtime/pkg/client" "sigs.k8s.io/controller-runtime/pkg/controller" "sigs.k8s.io/controller-runtime/pkg/controller/controllerutil" @@ -913,7 +913,7 @@ func deploymentForConfigurer(v *vaultv1alpha1.Vault, configmaps corev1.ConfigMap podSpec := corev1.PodSpec{ ServiceAccountName: v.Spec.GetServiceAccount(), - AutomountServiceAccountToken: pointer.Bool(true), + AutomountServiceAccountToken: ptr.To(true), Containers: []corev1.Container{ { @@ -959,7 +959,7 @@ func deploymentForConfigurer(v *vaultv1alpha1.Vault, configmaps corev1.ConfigMap Selector: &metav1.LabelSelector{ MatchLabels: ls, }, - RevisionHistoryLimit: pointer.Int32(0), + RevisionHistoryLimit: ptr.To(int32(0)), Template: corev1.PodTemplateSpec{ ObjectMeta: metav1.ObjectMeta{ Labels: withVaultConfigurerLabels(v, ls), @@ -1266,8 +1266,8 @@ func statefulSetForVault(v *vaultv1alpha1.Vault, externalSecretsToWatchItems []c VolumeMounts: withHSMVolumeMount(v, nil), Resources: getHSMDaemonResource(v), SecurityContext: &corev1.SecurityContext{ - Privileged: pointer.Bool(true), - RunAsUser: pointer.Int64(0), + Privileged: ptr.To(true), + RunAsUser: ptr.To(int64(0)), }, }) } @@ -1285,7 +1285,7 @@ func statefulSetForVault(v *vaultv1alpha1.Vault, externalSecretsToWatchItems []c Affinity: affinity, ServiceAccountName: v.Spec.GetServiceAccount(), - AutomountServiceAccountToken: pointer.Bool(true), + AutomountServiceAccountToken: ptr.To(true), InitContainers: withVaultInitContainers(v, []corev1.Container{ { @@ -1676,7 +1676,7 @@ func withVeleroContainer(v *vaultv1alpha1.Vault, containers []corev1.Container) Command: []string{"/bin/bash", "-c", "sleep infinity"}, VolumeMounts: withVaultVolumeMounts(v, nil), SecurityContext: &corev1.SecurityContext{ - Privileged: pointer.Bool(true), + Privileged: ptr.To(true), }, Resources: corev1.ResourceRequirements{ Requests: corev1.ResourceList{