There is a missing call to Close on the gzip.Writer that is used to
compress newly created tar-split files during layer migration. This can
result in corrupt tar-split files that later cause docker push and
docker save to fail. The Close call is necessary to flush buffered data
to the stream.
Fixes: #20104
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
| ... | ... |
@@ -127,6 +127,7 @@ func (ls *layerStore) checksumForGraphIDNoTarsplit(id, parent, newTarDataPath st |
| 127 | 127 |
} |
| 128 | 128 |
defer f.Close() |
| 129 | 129 |
mfz := gzip.NewWriter(f) |
| 130 |
+ defer mfz.Close() |
|
| 130 | 131 |
metaPacker := storage.NewJSONPacker(mfz) |
| 131 | 132 |
|
| 132 | 133 |
packerCounter := &packSizeCounter{metaPacker, &size}
|