Skip to content

Commit 8f65834

Browse files
committed
Re-add aliases
1 parent 2e246e9 commit 8f65834

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

pkg/webhook/admission/validator_custom.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ func (h *validatorForType[T]) Handle(ctx context.Context, req Request) Response
117117

118118
warnings, err = h.validator.ValidateCreate(ctx, obj)
119119
case v1.Update:
120-
oldObj := h.new().(T)
120+
oldObj := h.new()
121121
if err := h.decoder.DecodeRaw(req.Object, obj); err != nil {
122122
return Errored(http.StatusBadRequest, err)
123123
}

pkg/webhook/alias.go

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ import (
2323

2424
// define some aliases for common bits of the webhook functionality
2525

26+
// CustomDefaulter defines functions for setting defaults on resources.
27+
// Deprecated: Use admission.Defaulter instead.
28+
type CustomDefaulter = admission.CustomDefaulter
29+
30+
// CustomValidator defines functions for validating an operation.
31+
// Deprecated: Use admission.Validator instead.
32+
type CustomValidator = admission.CustomValidator
33+
2634
// AdmissionRequest defines the input for an admission handler.
2735
// It contains information to identify the object in
2836
// question (group, version, kind, resource, subresource,

0 commit comments

Comments
 (0)