X Tutup
Skip to content

Commit 550518a

Browse files
committed
Read trailing data on apply
This was removed by mistake during the direct unpack PR refactoring. Signed-off-by: Derek McGowan <derek@mcgstyle.net>
1 parent 4924bcb commit 550518a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

diff/apply/apply.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ package apply
1919
import (
2020
"context"
2121
"io"
22+
"io/ioutil"
2223
"time"
2324

2425
"github.com/containerd/containerd/content"
@@ -97,6 +98,11 @@ func (s *fsApplier) Apply(ctx context.Context, desc ocispec.Descriptor, mounts [
9798
return emptyDesc, err
9899
}
99100

101+
// Read any trailing data
102+
if _, err := io.Copy(ioutil.Discard, rc); err != nil {
103+
return emptyDesc, err
104+
}
105+
100106
for _, p := range processors {
101107
if ep, ok := p.(interface {
102108
Err() error

0 commit comments

Comments
 (0)
X Tutup