Quellcode durchsuchen

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>
John Starks vor 9 Jahren
Ursprung
Commit
15b0f06a9a
2 geänderte Dateien mit 17 neuen und 5 gelöschten Zeilen
  1. 1 1
      hack/vendor.sh
  2. 16 4
      vendor/src/github.com/Microsoft/hcsshim/baselayer.go

+ 1 - 1
hack/vendor.sh

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

+ 16 - 4
vendor/src/github.com/Microsoft/hcsshim/baselayer.go

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