@@ -64,7 +64,7 @@ func WebhookManagedBy[T runtime.Object](m manager.Manager, object T) *WebhookBui
6464
6565// WithDefaulter takes an admission.CustomDefaulter interface, a MutatingWebhook with the provided opts (admission.DefaulterOption)
6666// will be wired for this type.
67- // deprecated : Use WithAdmissionDefaulter instead.
67+ // Deprecated : Use WithAdmissionDefaulter instead.
6868func (blder * WebhookBuilder [T ]) WithDefaulter (defaulter admission.CustomDefaulter , opts ... admission.DefaulterOption ) * WebhookBuilder [T ] {
6969 blder .customDefaulter = defaulter
7070 blder .customDefaulterOpts = opts
@@ -79,7 +79,7 @@ func (blder *WebhookBuilder[T]) WithAdmissionDefaulter(defaulter admission.Defau
7979}
8080
8181// WithValidator takes a admission.CustomValidator interface, a ValidatingWebhook will be wired for this type.
82- // deprecated : Use WithAdmissionValidator instead.
82+ // Deprecated : Use WithAdmissionValidator instead.
8383func (blder * WebhookBuilder [T ]) WithValidator (validator admission.CustomValidator ) * WebhookBuilder [T ] {
8484 blder .customValidator = validator
8585 return blder
@@ -254,9 +254,6 @@ func (blder *WebhookBuilder[T]) getDefaultingWebhook() *admission.Webhook {
254254 w = admission .WithDefaulter (blder .mgr .GetScheme (), blder .defaulter , blder .customDefaulterOpts ... )
255255 } else if customDefaulter := blder .customDefaulter ; customDefaulter != nil {
256256 w = admission .WithCustomDefaulter (blder .mgr .GetScheme (), blder .apiType , customDefaulter , blder .customDefaulterOpts ... )
257- if blder .recoverPanic != nil {
258- }
259- return w
260257 }
261258 if w != nil && blder .recoverPanic != nil {
262259 w = w .WithRecoverPanic (* blder .recoverPanic )
@@ -298,12 +295,11 @@ func (blder *WebhookBuilder[T]) getValidatingWebhook() *admission.Webhook {
298295 w = admission .WithValidator (blder .mgr .GetScheme (), validator )
299296 } else if customValidator := blder .customValidator ; customValidator != nil {
300297 w = admission .WithCustomValidator (blder .mgr .GetScheme (), blder .apiType , customValidator )
301- return w
302298 }
303299 if w != nil && blder .recoverPanic != nil {
304300 w = w .WithRecoverPanic (* blder .recoverPanic )
305301 }
306- return nil
302+ return w
307303}
308304
309305func (blder * WebhookBuilder [T ]) registerConversionWebhook () error {
0 commit comments