summaryrefslogtreecommitdiff
path: root/vendor/github.com/opencontainers/runtime-tools/generate/generate.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/opencontainers/runtime-tools/generate/generate.go')
-rw-r--r--vendor/github.com/opencontainers/runtime-tools/generate/generate.go34
1 files changed, 27 insertions, 7 deletions
diff --git a/vendor/github.com/opencontainers/runtime-tools/generate/generate.go b/vendor/github.com/opencontainers/runtime-tools/generate/generate.go
index 955a9d5f9..1eb44770f 100644
--- a/vendor/github.com/opencontainers/runtime-tools/generate/generate.go
+++ b/vendor/github.com/opencontainers/runtime-tools/generate/generate.go
@@ -39,23 +39,43 @@ type ExportOptions struct {
// New creates a configuration Generator with the default
// configuration for the target operating system.
func New(os string) (generator Generator, err error) {
- if os != "linux" && os != "solaris" {
+ if os != "linux" && os != "solaris" && os != "windows" {
return generator, fmt.Errorf("no defaults configured for %s", os)
}
config := rspec.Spec{
- Version: rspec.Version,
- Root: &rspec.Root{
+ Version: rspec.Version,
+ Hostname: "mrsdalloway",
+ }
+
+ if os == "windows" {
+ config.Process = &rspec.Process{
+ Args: []string{
+ "cmd",
+ },
+ Cwd: `C:\`,
+ ConsoleSize: &rspec.Box{
+ Width: 80,
+ Height: 20,
+ },
+ }
+ config.Windows = &rspec.Windows{
+ IgnoreFlushesDuringBoot: true,
+ Network: &rspec.WindowsNetwork{
+ AllowUnqualifiedDNSQuery: true,
+ },
+ }
+ } else {
+ config.Root = &rspec.Root{
Path: "rootfs",
Readonly: false,
- },
- Process: &rspec.Process{
+ }
+ config.Process = &rspec.Process{
Terminal: false,
Args: []string{
"sh",
},
- },
- Hostname: "mrsdalloway",
+ }
}
if os == "linux" || os == "solaris" {