From 0f3847473518ef3c546756d3324208c33aa7fc52 Mon Sep 17 00:00:00 2001 From: Simon Tien Date: Tue, 3 Dec 2024 07:50:10 +1100 Subject: [PATCH] fix: pr feedback --- pkg/yurtmanager/webhook/endpoints/v1/endpoints_default.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/yurtmanager/webhook/endpoints/v1/endpoints_default.go b/pkg/yurtmanager/webhook/endpoints/v1/endpoints_default.go index cf7160d168b..fe25c2e505b 100644 --- a/pkg/yurtmanager/webhook/endpoints/v1/endpoints_default.go +++ b/pkg/yurtmanager/webhook/endpoints/v1/endpoints_default.go @@ -33,7 +33,7 @@ import ( func (webhook *EndpointsHandler) Default(ctx context.Context, obj runtime.Object) error { endpoints, ok := obj.(*corev1.Endpoints) if !ok { - return fmt.Errorf("expected an Endpoints object but got %T", obj) + apierrors.NewBadRequest(fmt.Sprintf("expected an Endpoints object but got %T", obj)) } return remapAutonomyEndpoints(ctx, webhook.Client, endpoints)