forked from TrueCloudLab/distribution
Migrate references to consolidated v2 package
Routes and errors are now all referenced from a single v2 package. This packages exports are acceptable for use in the server side as well as integration into docker core.
This commit is contained in:
parent
5abfc91021
commit
d08f0edcf1
13 changed files with 82 additions and 83 deletions
8
layer.go
8
layer.go
|
@ -3,7 +3,7 @@ package registry
|
|||
import (
|
||||
"net/http"
|
||||
|
||||
"github.com/docker/docker-registry/api/errors"
|
||||
"github.com/docker/docker-registry/api/v2"
|
||||
"github.com/docker/docker-registry/digest"
|
||||
"github.com/docker/docker-registry/storage"
|
||||
"github.com/gorilla/handlers"
|
||||
|
@ -15,7 +15,7 @@ func layerDispatcher(ctx *Context, r *http.Request) http.Handler {
|
|||
|
||||
if err != nil {
|
||||
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
ctx.Errors.Push(errors.ErrorCodeDigestInvalid, err)
|
||||
ctx.Errors.Push(v2.ErrorCodeDigestInvalid, err)
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -50,9 +50,9 @@ func (lh *layerHandler) GetLayer(w http.ResponseWriter, r *http.Request) {
|
|||
switch err := err.(type) {
|
||||
case storage.ErrUnknownLayer:
|
||||
w.WriteHeader(http.StatusNotFound)
|
||||
lh.Errors.Push(errors.ErrorCodeBlobUnknown, err.FSLayer)
|
||||
lh.Errors.Push(v2.ErrorCodeBlobUnknown, err.FSLayer)
|
||||
default:
|
||||
lh.Errors.Push(errors.ErrorCodeUnknown, err)
|
||||
lh.Errors.Push(v2.ErrorCodeUnknown, err)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue