Commit blob with known size
Signed-off-by: Michal Minar <miminar@redhat.com>
This commit is contained in:
parent
6344c99848
commit
21a0878665
1 changed files with 8 additions and 2 deletions
|
@ -239,12 +239,18 @@ func (buh *blobUploadHandler) PutBlobUploadComplete(w http.ResponseWriter, r *ht
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
size := buh.State.Offset
|
||||||
|
if offset, err := buh.Upload.Seek(0, os.SEEK_CUR); err == nil {
|
||||||
|
size = offset
|
||||||
|
}
|
||||||
|
|
||||||
desc, err := buh.Upload.Commit(buh, distribution.Descriptor{
|
desc, err := buh.Upload.Commit(buh, distribution.Descriptor{
|
||||||
Digest: dgst,
|
Digest: dgst,
|
||||||
|
Size: size,
|
||||||
|
|
||||||
// TODO(stevvooe): This isn't wildly important yet, but we should
|
// TODO(stevvooe): This isn't wildly important yet, but we should
|
||||||
// really set the length and mediatype. For now, we can let the
|
// really set the mediatype. For now, we can let the backend take care
|
||||||
// backend take care of this.
|
// of this.
|
||||||
})
|
})
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
Loading…
Reference in a new issue