Merge pull request #11296 from ywk253100/200326_replication

Support replicate images with media type application/vnd.docker.distribution.manifest.v1+json
This commit is contained in:
Steven Zou 2020-03-27 18:12:12 +08:00 committed by GitHub
commit 1bbd3585e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 2 deletions

View File

@ -53,6 +53,7 @@ var (
v1.MediaTypeImageManifest,
schema2.MediaTypeManifest,
schema1.MediaTypeSignedManifest,
schema1.MediaTypeManifest,
}
)
@ -473,7 +474,7 @@ func (c *client) Copy(srcRepo, srcRef, dstRepo, dstRef string, override bool) er
// manifest or index
case v1.MediaTypeImageIndex, manifestlist.MediaTypeManifestList,
v1.MediaTypeImageManifest, schema2.MediaTypeManifest,
schema1.MediaTypeSignedManifest:
schema1.MediaTypeSignedManifest, schema1.MediaTypeManifest:
if err = c.Copy(srcRepo, digest, dstRepo, digest, false); err != nil {
return err
}

View File

@ -230,7 +230,7 @@ func (t *transfer) copyContent(content distribution.Descriptor, srcRepo, dstRepo
// the contents it contains are a few manifests/indexes
case v1.MediaTypeImageIndex, manifestlist.MediaTypeManifestList,
v1.MediaTypeImageManifest, schema2.MediaTypeManifest,
schema1.MediaTypeSignedManifest:
schema1.MediaTypeSignedManifest, schema1.MediaTypeManifest:
// as using digest as the reference, so set the override to true directly
return t.copyArtifact(srcRepo, digest, dstRepo, digest, true)
// handle foreign layer