From cef9d11f589a0d8e36f58a584ba154ba7a3abf25 Mon Sep 17 00:00:00 2001 From: Ian Campbell Date: Mon, 20 Nov 2017 15:26:51 +0000 Subject: [PATCH] Only create metadata if file is non-zero sized The recent iso9660wrap vendoring bump means this does now work, but it seems pointless in this case so skip. Relates to https://github.com/linuxkit/kubernetes/issues/4 Signed-off-by: Ian Campbell --- src/cmd/linuxkit/util.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/cmd/linuxkit/util.go b/src/cmd/linuxkit/util.go index c47d7cefd..f0147af28 100644 --- a/src/cmd/linuxkit/util.go +++ b/src/cmd/linuxkit/util.go @@ -262,8 +262,10 @@ func CreateMetadataISO(state, data string) ([]string, error) { } var d []byte - if _, err := os.Stat(data); os.IsNotExist(err) { + if st, err := os.Stat(data); os.IsNotExist(err) { d = []byte(data) + } else if st.Size() == 0 { + return []string{}, nil } else { d, err = ioutil.ReadFile(data) if err != nil {