Prevent push by tag for sub-manifests
When pushing a manifest list, all manifests should be pushed by digest and only the final manifest pushed by tag. The Pusher was preventing this by mistakenly disallowing objects to contain a digest. When objects have a digest, only push tags associated with that digest. Signed-off-by: Derek McGowan <derek@mcgstyle.net>
This commit is contained in:
@@ -403,6 +403,11 @@ func (c *Client) Push(ctx context.Context, ref string, desc ocispec.Descriptor,
|
||||
}
|
||||
}
|
||||
|
||||
// Annotate ref with digest to push only push tag for single digest
|
||||
if !strings.Contains(ref, "@") {
|
||||
ref = ref + "@" + desc.Digest.String()
|
||||
}
|
||||
|
||||
pusher, err := pushCtx.Resolver.Pusher(ctx, ref)
|
||||
if err != nil {
|
||||
return err
|
||||
|
Reference in New Issue
Block a user