From 550518ab84ec406abe519d9131ec263e1edf3bfb Mon Sep 17 00:00:00 2001 From: Derek McGowan Date: Wed, 21 Aug 2019 11:41:56 -0700 Subject: [PATCH] Read trailing data on apply This was removed by mistake during the direct unpack PR refactoring. Signed-off-by: Derek McGowan --- diff/apply/apply.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/diff/apply/apply.go b/diff/apply/apply.go index 97c065d8c..ce89daaf2 100644 --- a/diff/apply/apply.go +++ b/diff/apply/apply.go @@ -19,6 +19,7 @@ package apply import ( "context" "io" + "io/ioutil" "time" "github.com/containerd/containerd/content" @@ -97,6 +98,11 @@ func (s *fsApplier) Apply(ctx context.Context, desc ocispec.Descriptor, mounts [ return emptyDesc, err } + // Read any trailing data + if _, err := io.Copy(ioutil.Discard, rc); err != nil { + return emptyDesc, err + } + for _, p := range processors { if ep, ok := p.(interface { Err() error