Skip to content

Commit 8b8494e

Browse files
authored
Merge pull request containerd#4661 from kevpar/1.4-lcow-tar
[release/1.4] cherry-pick: Read trailing data from tar reader
2 parents 013411a + 88e7f23 commit 8b8494e

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

diff/lcow/lcow.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ package lcow
2121
import (
2222
"context"
2323
"io"
24+
"io/ioutil"
2425
"os"
2526
"path"
2627
"time"
@@ -163,6 +164,11 @@ func (s windowsLcowDiff) Apply(ctx context.Context, desc ocispec.Descriptor, mou
163164
}
164165
outFile.Close()
165166

167+
// Read any trailing data
168+
if _, err := io.Copy(ioutil.Discard, rc); err != nil {
169+
return emptyDesc, err
170+
}
171+
166172
err = security.GrantVmGroupAccess(layerPath)
167173
if err != nil {
168174
return emptyDesc, errors.Wrapf(err, "failed GrantVmGroupAccess on layer vhd: %v", layerPath)

0 commit comments

Comments
 (0)