Skip to content

Commit

Permalink
hook: fix the decoder variable type
Browse files Browse the repository at this point in the history
admission.Decoder has been changed to the interface,
so the decoder variable should not be a pointer now.

cf. kubernetes-sigs/controller-runtime#2736

Signed-off-by: Shinya Hayashi <shinya-hayashi@cybozu.co.jp>
  • Loading branch information
peng225 committed Jun 26, 2024
1 parent ddaeaff commit 21a4dd6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions internal/hook/mutate_persistentvolumeclaim.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down
4 changes: 2 additions & 2 deletions internal/hook/mutate_pod.go
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down

0 comments on commit 21a4dd6

Please sign in to comment.