mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Don’t overwrite layer checksum on push
After v1.8.3 layer checksum is used for image ID validation. Rewriting the checksums on push would mean that next pulls will get different image IDs and pulls may fail if its detected that same manifest digest can now point to new image ID. Fixes #17178 Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
This commit is contained in:
parent
bb085b7661
commit
fb4a725692
1 changed files with 5 additions and 3 deletions
|
@ -169,15 +169,17 @@ func (p *v2Pusher) pushV2Tag(tag string) error {
|
|||
// if digest was empty or not saved, or if blob does not exist on the remote repository,
|
||||
// then fetch it.
|
||||
if !exists {
|
||||
if pushDigest, err := p.pushV2Image(p.repo.Blobs(context.Background()), layer); err != nil {
|
||||
var pushDigest digest.Digest
|
||||
if pushDigest, err = p.pushV2Image(p.repo.Blobs(context.Background()), layer); err != nil {
|
||||
return err
|
||||
} else if pushDigest != dgst {
|
||||
}
|
||||
if dgst == "" {
|
||||
// Cache new checksum
|
||||
if err := p.graph.SetLayerDigest(layer.ID, pushDigest); err != nil {
|
||||
return err
|
||||
}
|
||||
dgst = pushDigest
|
||||
}
|
||||
dgst = pushDigest
|
||||
}
|
||||
|
||||
// read v1Compatibility config, generate new if needed
|
||||
|
|
Loading…
Add table
Reference in a new issue