-
Notifications
You must be signed in to change notification settings - Fork 18.6k
/
start_windows.go
44 lines (37 loc) · 1.17 KB
/
start_windows.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
package daemon // import "github.com/docker/docker/daemon"
import (
"github.com/Microsoft/hcsshim/cmd/containerd-shim-runhcs-v1/options"
"github.com/Microsoft/opengcs/client"
"github.com/docker/docker/container"
"github.com/docker/docker/pkg/system"
)
func (daemon *Daemon) getLibcontainerdCreateOptions(container *container.Container) (string, interface{}, error) {
// Set the runtime options to debug regardless of current logging level.
if system.ContainerdRuntimeSupported() {
opts := &options.Options{Debug: true}
return "", opts, nil
}
// TODO (containerd) - Probably need to revisit LCOW options here
// rather than blindly ignoring them.
// LCOW options.
if container.OS == "linux" {
config := &client.Config{}
if err := config.GenerateDefault(daemon.configStore.GraphOptions); err != nil {
return "", nil, err
}
// Override from user-supplied options.
for k, v := range container.HostConfig.StorageOpt {
switch k {
case "lcow.kirdpath":
config.KirdPath = v
case "lcow.bootparameters":
config.BootParameters = v
}
}
if err := config.Validate(); err != nil {
return "", nil, err
}
return "", config, nil
}
return "", nil, nil
}