fix: unexpected HTTP status code (#6241)

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>
This commit is contained in:
hongming
2024-10-28 11:51:03 +08:00
committed by GitHub
parent 1fd47dda4d
commit 7992b75072

View File

@@ -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)
}