Merge pull request #17179 from tonistiigi/17178-dont-overwrite-layer-checksum

Don’t overwrite layer checksum on push
This commit is contained in:
Tibor Vass 2015-10-21 13:42:59 -04:00
commit 10430fd334

View file

@ -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