Windows: Revendor Microsoft/hcsshim

This change supports the importing of layers that contain utility VM
images. This is necessary to support Hyper-V containers running on a
non-centrally-managed image.

Signed-off-by: John Starks <jostarks@microsoft.com>
This commit is contained in:
John Starks 2016-04-06 17:46:19 -07:00
parent 577adcc1ee
commit 15b0f06a9a
2 changed files with 17 additions and 5 deletions

View File

@ -7,7 +7,7 @@ source 'hack/.vendor-helpers.sh'
# the following lines are in sorted order, FYI
clone git github.com/Azure/go-ansiterm 70b2c90b260171e829f1ebd7c17f600c11858dbe
clone git github.com/Microsoft/hcsshim v0.2.0
clone git github.com/Microsoft/hcsshim v0.2.1
clone git github.com/Microsoft/go-winio v0.3.0
clone git github.com/Sirupsen/logrus v0.9.0 # logrus is a common dependency among multiple deps
clone git github.com/docker/libtrust 9cbd2a1374f46905c68a4eb3694a130610adc62a

View File

@ -10,10 +10,11 @@ import (
)
type baseLayerWriter struct {
root string
f *os.File
bw *winio.BackupFileWriter
err error
root string
f *os.File
bw *winio.BackupFileWriter
err error
hasUtilityVM bool
}
func (w *baseLayerWriter) closeCurrentFile() error {
@ -44,6 +45,10 @@ func (w *baseLayerWriter) Add(name string, fileInfo *winio.FileBasicInfo) (err e
return err
}
if filepath.ToSlash(name) == `UtilityVM/Files` {
w.hasUtilityVM = true
}
path := filepath.Join(w.root, name)
path, err = makeLongAbsPath(path)
if err != nil {
@ -139,6 +144,13 @@ func (w *baseLayerWriter) Close() error {
if err != nil {
return err
}
if w.hasUtilityVM {
err = ProcessUtilityVMImage(filepath.Join(w.root, "UtilityVM"))
if err != nil {
return err
}
}
}
return w.err
}