mirror of
https://github.com/distribution/distribution.git
synced 2025-08-22 16:46:51 +00:00
Merge pull request #4 from digitalocean/awg/manifest-delete-by-tag
manifests: Return UNSUPPORTED when deleting manifests by tag
This commit is contained in:
commit
7796e5f437
@ -15,11 +15,11 @@ import (
|
|||||||
"github.com/docker/distribution/manifest/schema2"
|
"github.com/docker/distribution/manifest/schema2"
|
||||||
"github.com/docker/distribution/reference"
|
"github.com/docker/distribution/reference"
|
||||||
"github.com/docker/distribution/registry/api/errcode"
|
"github.com/docker/distribution/registry/api/errcode"
|
||||||
"github.com/docker/distribution/registry/api/v2"
|
v2 "github.com/docker/distribution/registry/api/v2"
|
||||||
"github.com/docker/distribution/registry/auth"
|
"github.com/docker/distribution/registry/auth"
|
||||||
"github.com/gorilla/handlers"
|
"github.com/gorilla/handlers"
|
||||||
"github.com/opencontainers/go-digest"
|
"github.com/opencontainers/go-digest"
|
||||||
"github.com/opencontainers/image-spec/specs-go/v1"
|
v1 "github.com/opencontainers/image-spec/specs-go/v1"
|
||||||
)
|
)
|
||||||
|
|
||||||
// These constants determine which architecture and OS to choose from a
|
// These constants determine which architecture and OS to choose from a
|
||||||
@ -485,6 +485,11 @@ func (imh *manifestHandler) applyResourcePolicy(manifest distribution.Manifest)
|
|||||||
func (imh *manifestHandler) DeleteManifest(w http.ResponseWriter, r *http.Request) {
|
func (imh *manifestHandler) DeleteManifest(w http.ResponseWriter, r *http.Request) {
|
||||||
dcontext.GetLogger(imh).Debug("DeleteImageManifest")
|
dcontext.GetLogger(imh).Debug("DeleteImageManifest")
|
||||||
|
|
||||||
|
if imh.Tag != "" {
|
||||||
|
imh.Errors = append(imh.Errors, errcode.ErrorCodeUnsupported)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
manifests, err := imh.Repository.Manifests(imh)
|
manifests, err := imh.Repository.Manifests(imh)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
imh.Errors = append(imh.Errors, err)
|
imh.Errors = append(imh.Errors, err)
|
||||||
|
Loading…
Reference in New Issue
Block a user