diff --git a/routes.go b/routes.go index 10c9e398..d4942696 100644 --- a/routes.go +++ b/routes.go @@ -5,21 +5,21 @@ import ( ) const ( - routeNameRoot = "root" - routeNameName = "name" - routeNameImageManifest = "image-manifest" - routeNameTags = "tags" - routeNameLayer = "layer" - routeNameStartLayerUpload = "start-layer-upload" - routeNameLayerUpload = "layer-upload" + routeNameRoot = "root" + routeNameName = "name" + routeNameImageManifest = "image-manifest" + routeNameTags = "tags" + routeNameLayer = "layer" + routeNameLayerUpload = "layer-upload" + routeNameLayerUploadResume = "layer-upload-resume" ) var allEndpoints = []string{ routeNameImageManifest, routeNameTags, routeNameLayer, - routeNameStartLayerUpload, routeNameLayerUpload, + routeNameLayerUploadResume, } // v2APIRouter builds a gorilla router with named routes for the various API @@ -59,14 +59,14 @@ func v2APIRouter() *mux.Router { // POST /v2//layer//upload/ Layer Upload Initiate an upload of the layer identified by tarsum. Requires length and a checksum parameter. namedRouter. Path("/layer/{tarsum}/upload/"). - Name(routeNameStartLayerUpload) + Name(routeNameLayerUpload) // GET /v2//layer//upload/ Layer Upload Get the status of the upload identified by tarsum and uuid. // PUT /v2//layer//upload/ Layer Upload Upload all or a chunk of the upload identified by tarsum and uuid. // DELETE /v2//layer//upload/ Layer Upload Cancel the upload identified by layer and uuid namedRouter. Path("/layer/{tarsum}/upload/{uuid}"). - Name(routeNameLayerUpload) + Name(routeNameLayerUploadResume) return router } diff --git a/routes_test.go b/routes_test.go index 6b1daf80..e3ef371a 100644 --- a/routes_test.go +++ b/routes_test.go @@ -76,7 +76,7 @@ func TestRouter(t *testing.T) { }, }, { - routeName: routeNameStartLayerUpload, + routeName: routeNameLayerUpload, expectedRouteInfo: routeInfo{ RequestURI: "/v2/foo/bar/layer/tarsum/upload/", Vars: map[string]string{ @@ -86,7 +86,7 @@ func TestRouter(t *testing.T) { }, }, { - routeName: routeNameLayerUpload, + routeName: routeNameLayerUploadResume, expectedRouteInfo: routeInfo{ RequestURI: "/v2/foo/bar/layer/tarsum/upload/uuid", Vars: map[string]string{