LCOW: Write saved manifest.json in Unix paths

Signed-off-by: John Howard <jhoward@microsoft.com>
This commit is contained in:
John Howard 2018-03-14 10:00:15 -07:00
parent 6b4f989bc2
commit 0a49de4eb5
1 changed files with 6 additions and 1 deletions

View File

@ -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{