Change some incorrect error types in proxy stores from API errors to

distribution errors.  Fill in missing checks for mutations on a registry pull-through
cache.  Add unit tests and update documentation.

Also, give v2.ErrorCodeUnsupported an HTTP status code, previously it was
defaulting to 500, now its 405 Method Not Allowed.

Signed-off-by: Richard Scothern <richard.scothern@gmail.com>
This commit is contained in:
Richard Scothern 2015-08-11 11:00:30 -07:00
parent ed3ecfdccb
commit 43fc9a195d
7 changed files with 114 additions and 15 deletions

View file

@ -7,7 +7,6 @@ import (
"github.com/docker/distribution/context"
"github.com/docker/distribution/digest"
"github.com/docker/distribution/manifest"
"github.com/docker/distribution/registry/api/errcode"
"github.com/docker/distribution/registry/client"
"github.com/docker/distribution/registry/proxy/scheduler"
)
@ -147,9 +146,9 @@ func manifestDigest(sm *manifest.SignedManifest) (digest.Digest, error) {
}
func (pms proxyManifestStore) Put(manifest *manifest.SignedManifest) error {
return errcode.ErrorCodeUnsupported
return distribution.ErrUnsupported
}
func (pms proxyManifestStore) Delete(dgst digest.Digest) error {
return errcode.ErrorCodeUnsupported
return distribution.ErrUnsupported
}