From a2e4c2ffca575eee4a4e0ed358a11df5878f9fca Mon Sep 17 00:00:00 2001 From: John Howard Date: Wed, 14 Mar 2018 10:00:15 -0700 Subject: [PATCH] LCOW: Write saved manifest.json in Unix paths Signed-off-by: John Howard Upstream-commit: 0a49de4eb551510cf4aafa7d212ec2bb8041f642 Component: engine --- components/engine/image/tarexport/save.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/components/engine/image/tarexport/save.go b/components/engine/image/tarexport/save.go index 9d7f92a452..4e734b3503 100644 --- a/components/engine/image/tarexport/save.go +++ b/components/engine/image/tarexport/save.go @@ -6,6 +6,7 @@ import ( "io" "io/ioutil" "os" + "path" "path/filepath" "runtime" "time" @@ -219,7 +220,11 @@ func (s *saveSession) save(outStream io.Writer) error { } for _, l := range imageDescr.layers { - layers = append(layers, filepath.Join(l, legacyLayerFileName)) + // IMPORTANT: We use path, not filepath here to ensure the layers + // in the manifest use Unix-style forward-slashes. Otherwise, a + // Linux image saved from LCOW won't be able to be imported on + // LCOL. + layers = append(layers, path.Join(l, legacyLayerFileName)) } manifest = append(manifest, manifestItem{