From 21a4dd62c6edeef904f201fa3062c08e700064bd Mon Sep 17 00:00:00 2001 From: Shinya Hayashi Date: Wed, 26 Jun 2024 09:04:30 +0000 Subject: [PATCH] hook: fix the decoder variable type admission.Decoder has been changed to the interface, so the decoder variable should not be a pointer now. cf. https://github.com/kubernetes-sigs/controller-runtime/pull/2736 Signed-off-by: Shinya Hayashi --- internal/hook/mutate_persistentvolumeclaim.go | 4 ++-- internal/hook/mutate_pod.go | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/internal/hook/mutate_persistentvolumeclaim.go b/internal/hook/mutate_persistentvolumeclaim.go index bc082c398..3d7a744f2 100644 --- a/internal/hook/mutate_persistentvolumeclaim.go +++ b/internal/hook/mutate_persistentvolumeclaim.go @@ -19,11 +19,11 @@ import ( type persistentVolumeClaimMutator struct { getter *getter.RetryMissingGetter - decoder *admission.Decoder + decoder admission.Decoder } // PVCMutator creates a mutating webhook for PVCs. -func PVCMutator(r client.Reader, apiReader client.Reader, dec *admission.Decoder) http.Handler { +func PVCMutator(r client.Reader, apiReader client.Reader, dec admission.Decoder) http.Handler { return &webhook.Admission{ Handler: &persistentVolumeClaimMutator{ getter: getter.NewRetryMissingGetter(r, apiReader), diff --git a/internal/hook/mutate_pod.go b/internal/hook/mutate_pod.go index adf244d0c..c1ed8c22e 100644 --- a/internal/hook/mutate_pod.go +++ b/internal/hook/mutate_pod.go @@ -28,11 +28,11 @@ var pmLogger = ctrl.Log.WithName("pod-mutator") // podMutator mutates pods using PVC for TopoLVM. type podMutator struct { getter *getter.RetryMissingGetter - decoder *admission.Decoder + decoder admission.Decoder } // PodMutator creates a mutating webhook for Pods. -func PodMutator(r client.Reader, apiReader client.Reader, dec *admission.Decoder) http.Handler { +func PodMutator(r client.Reader, apiReader client.Reader, dec admission.Decoder) http.Handler { return &webhook.Admission{ Handler: &podMutator{ getter: getter.NewRetryMissingGetter(r, apiReader),