Add some tests for bundlefile and improve the error messages for LoadFile
Signed-off-by: Daniel Nephin <dnephin@docker.com> Upstream-commit: c0ea589c1b27f8b68e84cfe6692a7639da52ce6d Component: engine
This commit is contained in:
@ -31,7 +31,12 @@ func loadBundlefile(stderr io.Writer, namespace string, path string) (*bundlefil
|
||||
}
|
||||
|
||||
fmt.Fprintf(stderr, "Loading bundle from %s\n", path)
|
||||
bundle, err := bundlefile.LoadFile(path)
|
||||
reader, err := os.Open(path)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
bundle, err := bundlefile.LoadFile(reader)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Error reading %s: %v\n", path, err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user