Skip to content

Commit

Permalink
Merge pull request #2020 from tonistiigi/push-tags
Browse files Browse the repository at this point in the history
push: avoid overwriting tags on push
  • Loading branch information
AkihiroSuda authored Mar 16, 2021
2 parents c5c2af7 + 1d7526b commit 4eca10a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion util/push/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,12 @@ func Push(ctx context.Context, sm *session.Manager, sid string, provider content
if byDigest {
ref = parsed.Name()
} else {
ref = reference.TagNameOnly(parsed).String()
// add digest to ref, this is what containderd uses to choose root manifest from all manifests
r, err := reference.WithDigest(reference.TagNameOnly(parsed), dgst)
if err != nil {
return errors.Wrapf(err, "failed to combine ref %s with digest %s", ref, dgst)
}
ref = r.String()
}

scope := "push"
Expand Down

0 comments on commit 4eca10a

Please sign in to comment.