Skip to content

Commit 5e3a6da

Browse files
author
Mengqi Yu
committed
🏃 move example for builtin type
1 parent 69e51f7 commit 5e3a6da

File tree

4 files changed

+2
-2
lines changed

4 files changed

+2
-2
lines changed
File renamed without changes.
File renamed without changes.

example/mutatingwebhook.go renamed to examples/builtins/mutatingwebhook.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ type podAnnotator struct {
3636
func (a *podAnnotator) Handle(ctx context.Context, req admission.Request) admission.Response {
3737
pod := &corev1.Pod{}
3838

39-
err := a.decoder.Decode(req.Object, pod)
39+
err := a.decoder.Decode(req, pod)
4040
if err != nil {
4141
return admission.Errored(http.StatusBadRequest, err)
4242
}

example/validatingwebhook.go renamed to examples/builtins/validatingwebhook.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ type podValidator struct {
3636
func (v *podValidator) Handle(ctx context.Context, req admission.Request) admission.Response {
3737
pod := &corev1.Pod{}
3838

39-
err := v.decoder.Decode(req.Object, pod)
39+
err := v.decoder.Decode(req, pod)
4040
if err != nil {
4141
return admission.Errored(http.StatusBadRequest, err)
4242
}

0 commit comments

Comments
 (0)