Skip to content

Commit

Permalink
fix StatefulSetCreateUpdateHandler client nil
Browse files Browse the repository at this point in the history
  • Loading branch information
shiyan2016 committed Sep 3, 2024
1 parent 4918768 commit 21a32e5
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
"context"
"fmt"
"net/http"
"sigs.k8s.io/controller-runtime/pkg/runtime/inject"

admissionv1 "k8s.io/api/admission/v1"
"k8s.io/klog/v2"
Expand Down Expand Up @@ -143,10 +144,10 @@ func (h *StatefulSetCreateUpdateHandler) decodeOldObject(req admission.Request,
return nil
}

//var _ inject.Client = &StatefulSetCreateUpdateHandler{}
//
//// InjectClient injects the client into the StatefulSetCreateUpdateHandler
//func (h *StatefulSetCreateUpdateHandler) InjectClient(c client.Client) error {
// h.Client = c
// return nil
//}
var _ inject.Client = &StatefulSetCreateUpdateHandler{}

// InjectClient injects the client into the StatefulSetCreateUpdateHandler
func (h *StatefulSetCreateUpdateHandler) InjectClient(c client.Client) error {
h.Client = c
return nil
}

0 comments on commit 21a32e5

Please sign in to comment.