Merge pull request #17179 from tonistiigi/17178-dont-overwrite-layer-checksum
Don’t overwrite layer checksum on push
This commit is contained in:
commit
10430fd334
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…
Reference in a new issue