Browse code

Vendor Microsoft/hcsshim @ v0.5.2

Signed-off-by: John Howard <jhoward@microsoft.com>

John Howard authored on 2017/06/02 08:49:56
Showing 4 changed files
... ...
@@ -1,6 +1,6 @@
1 1
 # the following lines are in sorted order, FYI
2 2
 github.com/Azure/go-ansiterm 388960b655244e76e24c75f48631564eaefade62
3
-github.com/Microsoft/hcsshim v0.5.17
3
+github.com/Microsoft/hcsshim v0.5.23
4 4
 github.com/Microsoft/go-winio v0.4.2
5 5
 github.com/Sirupsen/logrus v0.11.0
6 6
 github.com/davecgh/go-spew 346938d642f2ec3594ed81d874461961cd0faa76
... ...
@@ -35,7 +35,6 @@ type ContainerProperties struct {
35 35
 	SystemType        string
36 36
 	Owner             string
37 37
 	SiloGUID          string            `json:"SiloGuid,omitempty"`
38
-	IsDummy           bool              `json:",omitempty"`
39 38
 	RuntimeID         string            `json:"RuntimeId,omitempty"`
40 39
 	IsRuntimeTemplate bool              `json:",omitempty"`
41 40
 	RuntimeImagePath  string            `json:",omitempty"`
... ...
@@ -121,7 +120,7 @@ const (
121 121
 // Supported resource types are Network and Request Types are Add/Remove
122 122
 type ResourceModificationRequestResponse struct {
123 123
 	Resource ResourceType `json:"ResourceType"`
124
-	Data     string       `json:"Settings"`
124
+	Data     interface{}  `json:"Settings"`
125 125
 	Request  RequestType  `json:"RequestType,omitempty"`
126 126
 }
127 127
 
... ...
@@ -585,7 +584,7 @@ func (container *container) CreateProcess(c *ProcessConfig) (Process, error) {
585 585
 		return nil, makeContainerError(container, operation, "", err)
586 586
 	}
587 587
 
588
-	logrus.Debugf(title+" succeeded id=%s processid=%s", container.id, process.processID)
588
+	logrus.Debugf(title+" succeeded id=%s processid=%d", container.id, process.processID)
589 589
 	return process, nil
590 590
 }
591 591
 
... ...
@@ -1,6 +1,7 @@
1 1
 package hcsshim
2 2
 
3 3
 import (
4
+	"encoding/json"
4 5
 	"io"
5 6
 	"time"
6 7
 )
... ...
@@ -8,16 +9,18 @@ import (
8 8
 // ProcessConfig is used as both the input of Container.CreateProcess
9 9
 // and to convert the parameters to JSON for passing onto the HCS
10 10
 type ProcessConfig struct {
11
-	ApplicationName  string
12
-	CommandLine      string
13
-	User             string
14
-	WorkingDirectory string
15
-	Environment      map[string]string
16
-	EmulateConsole   bool
17
-	CreateStdInPipe  bool
18
-	CreateStdOutPipe bool
19
-	CreateStdErrPipe bool
20
-	ConsoleSize      [2]uint
11
+	ApplicationName   string            `json:",omitempty"`
12
+	CommandLine       string            `json:",omitempty"`
13
+	User              string            `json:",omitempty"`
14
+	WorkingDirectory  string            `json:",omitempty"`
15
+	Environment       map[string]string `json:",omitempty"`
16
+	EmulateConsole    bool              `json:",omitempty"`
17
+	CreateStdInPipe   bool              `json:",omitempty"`
18
+	CreateStdOutPipe  bool              `json:",omitempty"`
19
+	CreateStdErrPipe  bool              `json:",omitempty"`
20
+	ConsoleSize       [2]uint           `json:",omitempty"`
21
+	CreateInUtilityVm bool              `json:",omitempty"` // Used by Linux Containers on Windows
22
+	OCISpecification  *json.RawMessage  `json:",omitempty"` // Used by Linux Containers on Windows
21 23
 }
22 24
 
23 25
 type Layer struct {
... ...
@@ -34,39 +37,50 @@ type MappedDir struct {
34 34
 }
35 35
 
36 36
 type HvRuntime struct {
37
-	ImagePath    string `json:",omitempty"`
38
-	SkipTemplate bool   `json:",omitempty"`
37
+	ImagePath       string `json:",omitempty"`
38
+	SkipTemplate    bool   `json:",omitempty"`
39
+	LinuxInitrdPath string `json:",omitempty"` // Host path to an initrd image for starting a Linux utility VM
40
+	LinuxKernelPath string `json:",omitempty"` // Host path to kernel for starting a Linux utility VM
41
+}
42
+
43
+type MappedVirtualDisk struct {
44
+	HostPath          string `json:",omitempty"` // Path to VHD on the host
45
+	ContainerPath     string // Platform-specific mount point path in the container
46
+	CreateInUtilityVM bool   `json:",omitempty"`
47
+	ReadOnly          bool   `json:",omitempty"`
48
+	Cache             string `json:",omitempty"` // "" (Unspecified); "Disabled"; "Enabled"; "Private"; "PrivateAllowSharing"
39 49
 }
40 50
 
41 51
 // ContainerConfig is used as both the input of CreateContainer
42 52
 // and to convert the parameters to JSON for passing onto the HCS
43 53
 type ContainerConfig struct {
44
-	SystemType                 string      // HCS requires this to be hard-coded to "Container"
45
-	Name                       string      // Name of the container. We use the docker ID.
46
-	Owner                      string      // The management platform that created this container
47
-	IsDummy                    bool        // Used for development purposes.
48
-	VolumePath                 string      `json:",omitempty"` // Windows volume path for scratch space. Used by Windows Server Containers only. Format \\?\\Volume{GUID}
49
-	IgnoreFlushesDuringBoot    bool        // Optimization hint for container startup in Windows
50
-	LayerFolderPath            string      `json:",omitempty"` // Where the layer folders are located. Used by Windows Server Containers only. Format  %root%\windowsfilter\containerID
51
-	Layers                     []Layer     // List of storage layers. Required for Windows Server and Hyper-V Containers. Format ID=GUID;Path=%root%\windowsfilter\layerID
52
-	Credentials                string      `json:",omitempty"` // Credentials information
53
-	ProcessorCount             uint32      `json:",omitempty"` // Number of processors to assign to the container.
54
-	ProcessorWeight            uint64      `json:",omitempty"` // CPU Shares 0..10000 on Windows; where 0 will be omitted and HCS will default.
55
-	ProcessorMaximum           int64       `json:",omitempty"` // CPU maximum usage percent 1..100
56
-	StorageIOPSMaximum         uint64      `json:",omitempty"` // Maximum Storage IOPS
57
-	StorageBandwidthMaximum    uint64      `json:",omitempty"` // Maximum Storage Bandwidth in bytes per second
58
-	StorageSandboxSize         uint64      `json:",omitempty"` // Size in bytes that the container system drive should be expanded to if smaller
59
-	MemoryMaximumInMB          int64       `json:",omitempty"` // Maximum memory available to the container in Megabytes
60
-	HostName                   string      // Hostname
61
-	MappedDirectories          []MappedDir // List of mapped directories (volumes/mounts)
62
-	SandboxPath                string      `json:",omitempty"` // Location of unmounted sandbox. Used by Hyper-V containers only. Format %root%\windowsfilter
63
-	HvPartition                bool        // True if it a Hyper-V Container
64
-	EndpointList               []string    // List of networking endpoints to be attached to container
65
-	NetworkSharedContainerName string      `json:",omitempty"` // Name (ID) of the container that we will share the network stack with.
66
-	HvRuntime                  *HvRuntime  `json:",omitempty"` // Hyper-V container settings. Used by Hyper-V containers only. Format ImagePath=%root%\BaseLayerID\UtilityVM
67
-	Servicing                  bool        // True if this container is for servicing
68
-	AllowUnqualifiedDNSQuery   bool        // True to allow unqualified DNS name resolution
69
-	DNSSearchList              string      `json:",omitempty"` // Comma seperated list of DNS suffixes to use for name resolution
54
+	SystemType                  string              // HCS requires this to be hard-coded to "Container"
55
+	Name                        string              // Name of the container. We use the docker ID.
56
+	Owner                       string              `json:",omitempty"` // The management platform that created this container
57
+	VolumePath                  string              `json:",omitempty"` // Windows volume path for scratch space. Used by Windows Server Containers only. Format \\?\\Volume{GUID}
58
+	IgnoreFlushesDuringBoot     bool                `json:",omitempty"` // Optimization hint for container startup in Windows
59
+	LayerFolderPath             string              `json:",omitempty"` // Where the layer folders are located. Used by Windows Server Containers only. Format  %root%\windowsfilter\containerID
60
+	Layers                      []Layer             // List of storage layers. Required for Windows Server and Hyper-V Containers. Format ID=GUID;Path=%root%\windowsfilter\layerID
61
+	Credentials                 string              `json:",omitempty"` // Credentials information
62
+	ProcessorCount              uint32              `json:",omitempty"` // Number of processors to assign to the container.
63
+	ProcessorWeight             uint64              `json:",omitempty"` // CPU Shares 0..10000 on Windows; where 0 will be omitted and HCS will default.
64
+	ProcessorMaximum            int64               `json:",omitempty"` // CPU maximum usage percent 1..100
65
+	StorageIOPSMaximum          uint64              `json:",omitempty"` // Maximum Storage IOPS
66
+	StorageBandwidthMaximum     uint64              `json:",omitempty"` // Maximum Storage Bandwidth in bytes per second
67
+	StorageSandboxSize          uint64              `json:",omitempty"` // Size in bytes that the container system drive should be expanded to if smaller
68
+	MemoryMaximumInMB           int64               `json:",omitempty"` // Maximum memory available to the container in Megabytes
69
+	HostName                    string              `json:",omitempty"` // Hostname
70
+	MappedDirectories           []MappedDir         `json:",omitempty"` // List of mapped directories (volumes/mounts)
71
+	HvPartition                 bool                // True if it a Hyper-V Container
72
+	NetworkSharedContainerName  string              `json:",omitempty"` // Name (ID) of the container that we will share the network stack with.
73
+	EndpointList                []string            `json:",omitempty"` // List of networking endpoints to be attached to container
74
+	HvRuntime                   *HvRuntime          `json:",omitempty"` // Hyper-V container settings. Used by Hyper-V containers only. Format ImagePath=%root%\BaseLayerID\UtilityVM
75
+	Servicing                   bool                `json:",omitempty"` // True if this container is for servicing
76
+	AllowUnqualifiedDNSQuery    bool                `json:",omitempty"` // True to allow unqualified DNS name resolution
77
+	DNSSearchList               string              `json:",omitempty"` // Comma seperated list of DNS suffixes to use for name resolution
78
+	ContainerType               string              `json:",omitempty"` // "Linux" for Linux containers on Windows. Omitted otherwise.
79
+	TerminateOnLastHandleClosed bool                `json:",omitempty"` // Should HCS terminate the container once all handles have been closed
80
+	MappedVirtualDisks          []MappedVirtualDisk `json:",omitempty"` // Array of virtual disks to mount at start
70 81
 }
71 82
 
72 83
 type ComputeSystemQuery struct {
... ...
@@ -59,4 +59,5 @@ func waitForNotification(callbackNumber uintptr, expectedNotification hcsNotific
59 59
 	case <-c:
60 60
 		return ErrTimeout
61 61
 	}
62
+	return nil
62 63
 }