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 50ec0bbd4e
commit d2b2bf0393

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
}