diff --git a/pkg/chrootarchive/diff.go b/pkg/chrootarchive/diff.go index ac1cbf9bea..8d97c764db 100644 --- a/pkg/chrootarchive/diff.go +++ b/pkg/chrootarchive/diff.go @@ -5,7 +5,6 @@ import ( "encoding/json" "flag" "fmt" - "io" "io/ioutil" "os" "path/filepath" @@ -60,11 +59,7 @@ func ApplyLayer(dest string, layer archive.ArchiveReader) (size int64, err error return 0, err } - defer func() { - if c, ok := decompressed.(io.Closer); ok { - c.Close() - } - }() + defer decompressed.Close() cmd := reexec.Command("docker-applyLayer", dest) cmd.Stdin = decompressed