1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Inverted layer checksum and tarsum.

The checksum of the payload has to be computed on the Gzip'ed content.

Docker-DCO-1.1-Signed-off-by: Sam Alba <sam.alba@gmail.com> (github: samalba)
This commit is contained in:
Sam Alba 2014-03-31 17:56:25 -07:00
parent f6f059d99a
commit 3f0886c8c3

View file

@ -438,10 +438,10 @@ func (r *Registry) PushImageLayerRegistry(imgID string, layer io.Reader, registr
utils.Debugf("[registry] Calling PUT %s", registry+"images/"+imgID+"/layer")
h := sha256.New()
checksumLayer := &utils.CheckSum{Reader: layer, Hash: h}
tarsumLayer := &utils.TarSum{Reader: checksumLayer}
tarsumLayer := &utils.TarSum{Reader: layer}
checksumLayer := &utils.CheckSum{Reader: tarsumLayer, Hash: h}
req, err := r.reqFactory.NewRequest("PUT", registry+"images/"+imgID+"/layer", tarsumLayer)
req, err := r.reqFactory.NewRequest("PUT", registry+"images/"+imgID+"/layer", checksumLayer)
if err != nil {
return "", "", err
}