mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Adds cross-repository blob pushing behavior
Tracks source repository information for each blob in the blobsum service, which is then used to attempt to mount blobs from another repository when pushing instead of having to re-push blobs to the same registry. Signed-off-by: Brian Bland <brian.bland@docker.com>
This commit is contained in:
parent
9c9a1d1b4b
commit
7289c7218e
14 changed files with 335 additions and 42 deletions
|
|
@ -477,7 +477,7 @@ func migrateImage(id, root string, ls graphIDRegistrar, is image.Store, ms metad
|
|||
dgst, err := digest.ParseDigest(string(checksum))
|
||||
if err == nil {
|
||||
blobSumService := metadata.NewBlobSumService(ms)
|
||||
blobSumService.Add(layer.DiffID(), dgst)
|
||||
blobSumService.Add(layer.DiffID(), metadata.BlobSum{Digest: dgst})
|
||||
}
|
||||
}
|
||||
_, err = ls.Release(layer)
|
||||
|
|
|
|||
|
|
@ -216,9 +216,9 @@ func TestMigrateImages(t *testing.T) {
|
|||
t.Fatal(err)
|
||||
}
|
||||
|
||||
expectedBlobsums := []digest.Digest{
|
||||
"sha256:55dc925c23d1ed82551fd018c27ac3ee731377b6bad3963a2a4e76e753d70e57",
|
||||
"sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4",
|
||||
expectedBlobsums := []metadata.BlobSum{
|
||||
{Digest: digest.Digest("sha256:55dc925c23d1ed82551fd018c27ac3ee731377b6bad3963a2a4e76e753d70e57")},
|
||||
{Digest: digest.Digest("sha256:a3ed95caeb02ffe68cdd9fd84406680ae93d633cb16422d00e8a7c22955b46d4")},
|
||||
}
|
||||
|
||||
if !reflect.DeepEqual(expectedBlobsums, blobsums) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue