force the read of the tarSum so that sums actually get computed

Docker-DCO-1.1-Signed-off-by: Brice Jaglin <bjaglin@teads.tv> (github: bjaglin)
Upstream-commit: 9810da853bd890b6c963017555c3555ef9e0d842
Component: engine
This commit is contained in:
Brice Jaglin
2014-05-20 21:31:28 +00:00
committed by Victor Vieux
parent f91b76d592
commit 76507afd3a
+3
View File
@@ -571,6 +571,9 @@ func (b *buildFile) CmdAdd(args string) error {
return err
}
tarSum := utils.TarSum{Reader: r, DisableCompression: true}
if _, err := io.Copy(ioutil.Discard, &tarSum); err != nil {
return err
}
remoteHash = tarSum.Sum(nil)
r.Close()