diff --git a/pkg/api/controller_test.go b/pkg/api/controller_test.go index 4540002c..b9af61ba 100644 --- a/pkg/api/controller_test.go +++ b/pkg/api/controller_test.go @@ -4145,12 +4145,12 @@ func TestImageSignatures(t *testing.T) { resp, err = resty.R().Get( fmt.Sprintf("%s/oras/artifacts/v1/%s/manifests/%s/referrers", baseURL, repoName, digest.String())) So(err, ShouldBeNil) - So(resp.StatusCode(), ShouldEqual, http.StatusBadRequest) + So(resp.StatusCode(), ShouldEqual, http.StatusNotFound) resp, err = resty.R().SetQueryParam("artifactType", "badArtifact").Get( fmt.Sprintf("%s/oras/artifacts/v1/%s/manifests/%s/referrers", baseURL, repoName, digest.String())) So(err, ShouldBeNil) - So(resp.StatusCode(), ShouldEqual, http.StatusBadRequest) + So(resp.StatusCode(), ShouldEqual, http.StatusNotFound) resp, err = resty.R().SetQueryParam("artifactType", notreg.ArtifactTypeNotation).Get( fmt.Sprintf("%s/oras/artifacts/v1/%s/manifests/%s/referrers", baseURL, "badRepo", digest.String())) diff --git a/pkg/api/routes.go b/pkg/api/routes.go index f8f492ad..72f00a52 100644 --- a/pkg/api/routes.go +++ b/pkg/api/routes.go @@ -23,7 +23,6 @@ import ( "github.com/gorilla/mux" jsoniter "github.com/json-iterator/go" - notreg "github.com/notaryproject/notation-go/registry" "github.com/opencontainers/distribution-spec/specs-go/v1/extensions" godigest "github.com/opencontainers/go-digest" ispec "github.com/opencontainers/image-spec/specs-go/v1" @@ -1687,13 +1686,6 @@ func (rh *RouteHandler) GetOrasReferrers(response http.ResponseWriter, request * artifactType = artifactTypes[0] } - if artifactType != notreg.ArtifactTypeNotation { - rh.c.Log.Error().Str("artifactType", artifactType).Msg("invalid artifact type") - response.WriteHeader(http.StatusBadRequest) - - return - } - imgStore := rh.getImageStore(name) rh.c.Log.Info().Str("digest", digest.String()).Str("artifactType", artifactType).Msg("getting manifest")