1
1
mirror of https://github.com/go-gitea/gitea synced 2025-08-24 10:28:27 +00:00

Fix container blob mount (#22226) (#22476)

Backport #22226

Co-authored-by: KN4CK3R <admin@oldschoolhack.me>
This commit is contained in:
John Olheiser
2023-01-17 00:50:45 -06:00
committed by GitHub
parent 9a6d78eaa8
commit a9400ba7a3
5 changed files with 123 additions and 74 deletions

View File

@@ -196,10 +196,15 @@ func InitiateUploadBlob(ctx *context.Context) {
from := ctx.FormTrim("from")
if mount != "" {
blob, _ := workaroundGetContainerBlob(ctx, &container_model.BlobSearchOptions{
Image: from,
Digest: mount,
Repository: from,
Digest: mount,
})
if blob != nil {
if err := mountBlob(&packages_service.PackageInfo{Owner: ctx.Package.Owner, Name: image}, blob.Blob); err != nil {
apiError(ctx, http.StatusInternalServerError, err)
return
}
setResponseHeaders(ctx.Resp, &containerHeaders{
Location: fmt.Sprintf("/v2/%s/%s/blobs/%s", ctx.Package.Owner.LowerName, image, mount),
ContentDigest: mount,