Skip to content

Commit

Permalink
push: avoid overwriting tags on push
Browse files Browse the repository at this point in the history
Signed-off-by: Tonis Tiigi <[email protected]>
  • Loading branch information
tonistiigi committed Mar 12, 2021
1 parent 2be2384 commit 1d7526b
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 1d7526b

Please sign in to comment.