working commit
This commit is contained in:
+9
-8
@@ -13,7 +13,7 @@ func (hand *Handler) DumpHeaders(message string, rctx *router.Context) {
|
||||
hand.logg.Debugf("%s:\n%s\n", message, string(yamlData))
|
||||
}
|
||||
|
||||
// 1 HEAD /v2/<name>/blobs/<digest> 200 404
|
||||
// HEAD /v2/<name>/blobs/<digest> 200 404
|
||||
func (hand *Handler) BlobExists(rctx *router.Context) {
|
||||
name, _ := rctx.GetSubpath("name")
|
||||
digest, _ := rctx.GetSubpath("digest")
|
||||
@@ -34,7 +34,7 @@ func (hand *Handler) BlobExists(rctx *router.Context) {
|
||||
rctx.SetStatus(code)
|
||||
}
|
||||
|
||||
// 2 POST /v2/<name>/blobs/uploads/ 202 404
|
||||
// POST /v2/<name>/blobs/uploads/ 202 404
|
||||
func (hand *Handler) PostUpload(rctx *router.Context) {
|
||||
name, _ := rctx.GetSubpath("name")
|
||||
digest := rctx.GetQuery("digest")
|
||||
@@ -63,10 +63,10 @@ func (hand *Handler) PostUpload(rctx *router.Context) {
|
||||
// POST /v2/<name>/blobs/uploads/?digest=<digest> 201/202 404/400
|
||||
// POST /v2/<name>/blobs/uploads/?mount=<digest>&from=<other_name> 201 404
|
||||
|
||||
// 3 PATCH /v2/<name>/blobs/uploads/<reference> 202 404/416
|
||||
// PATCH /v2/<name>/blobs/uploads/<reference> 202 404/416
|
||||
func (hand *Handler) PatchUpload(rctx *router.Context) {
|
||||
|
||||
hand.DumpHeaders("PatchUpload headers", rctx)
|
||||
//hand.DumpHeaders("PatchUpload headers", rctx)
|
||||
|
||||
contentLength := rctx.GetHeader("Content-Length")
|
||||
contentType := rctx.GetHeader("Content-Type")
|
||||
@@ -90,15 +90,16 @@ func (hand *Handler) PatchUpload(rctx *router.Context) {
|
||||
hand.logg.Errorf("PatchUpload error: %v", err)
|
||||
}
|
||||
rctx.SetHeader("Location", res.Location)
|
||||
rctx.SetHeader("Range", res.Range)
|
||||
|
||||
rctx.SetStatus(code)
|
||||
}
|
||||
|
||||
// 4 PUT /v2/<name>/blobs/uploads/<reference>?digest=<digest> 202 404/416
|
||||
//
|
||||
// PUT /v2/<name>/uploads/<reference>?digest=<digest> 202 404/416
|
||||
// PUT /v2/<name>/blobs/uploads/<reference>?digest=<digest> 202 404/416
|
||||
// PUT /v2/<name>/uploads/<reference>?digest=<digest> 202 404/416
|
||||
func (hand *Handler) PutUpload(rctx *router.Context) {
|
||||
|
||||
hand.DumpHeaders("PutUpload headers", rctx)
|
||||
//hand.DumpHeaders("PutUpload headers", rctx)
|
||||
|
||||
contentType := rctx.GetHeader("Content-Type")
|
||||
contentLength := rctx.GetHeader("Content-Length")
|
||||
|
||||
+12
-5
@@ -87,14 +87,21 @@ func (hand *Handler) ManifestExists(rctx *router.Context) {
|
||||
|
||||
// PUT /v2/<name>/manifests/<reference> 201 404
|
||||
func (hand *Handler) PutManifest(rctx *router.Context) {
|
||||
|
||||
hand.DumpHeaders("PutManifest headers", rctx)
|
||||
|
||||
contentType := rctx.GetHeader("Content-Type")
|
||||
contentLength := rctx.GetHeader("Content-Length")
|
||||
|
||||
name, _ := rctx.GetSubpath("name")
|
||||
reference, _ := rctx.GetSubpath("reference")
|
||||
contentType := rctx.GetHeader("Content-Type")
|
||||
|
||||
params := &operator.PutManifestParams{
|
||||
ContentType: contentType,
|
||||
Name: name,
|
||||
Reference: reference,
|
||||
Reader: rctx.Request.Body,
|
||||
ContentType: contentType,
|
||||
ContentLength: contentLength,
|
||||
Name: name,
|
||||
Reference: reference,
|
||||
Reader: rctx.Request.Body,
|
||||
}
|
||||
ctx := rctx.GetContext()
|
||||
res, code, err := hand.oper.PutManifest(ctx, params)
|
||||
|
||||
Reference in New Issue
Block a user