From 0cf715a89a8fdcb27ce161e7c5757e96bd1d3d2f Mon Sep 17 00:00:00 2001 From: hongming Date: Mon, 28 Oct 2024 11:51:03 +0800 Subject: [PATCH] fix: unexpected HTTP status code (#6241) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix: Update member cluster mirror service verification response infor… (#1992) * fix: repository verify error * Update pkg/kapis/resources/v1alpha3/handler.go --------- Co-authored-by: smartcat999 <49057502+smartcat999@users.noreply.github.com> (cherry picked from commit 7992b7507299c677bbb7c50f9abe59f5f9522a29) --- pkg/kapis/resources/v1alpha3/handler.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pkg/kapis/resources/v1alpha3/handler.go b/pkg/kapis/resources/v1alpha3/handler.go index b68cac6be..2d4ca0527 100644 --- a/pkg/kapis/resources/v1alpha3/handler.go +++ b/pkg/kapis/resources/v1alpha3/handler.go @@ -133,8 +133,7 @@ func (h *handler) VerifyImageRepositorySecret(request *restful.Request, response ok, err := h.registryHelper.Auth(secret) if !ok { - klog.Error(err) - api.HandleUnauthorized(response, request, err) + api.HandleBadRequest(response, request, fmt.Errorf("registry auth failed with err: %s", err)) } else { response.WriteHeaderAndJson(http.StatusOK, secret, restful.MIME_JSON) }