Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows: Typos and incorrect defaults #683

Merged
merged 1 commit into from
Mar 5, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions cmd/oci-runtime-tool/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ var generateFlags = []cli.Flag{
cli.BoolFlag{Name: "windows-ignore-flushes-during-boot", Usage: "ignore flushes during boot"},
cli.StringSliceFlag{Name: "windows-layer-folders", Usage: "specifies a list of layer folders the container image relies on"},
cli.StringFlag{Name: "windows-network", Usage: "specifies network for container"},
cli.BoolFlag{Name: "windows-network-allowunqualifieddnsquery", Usage: "specifies networking unqualified DNS query is allowed"},
cli.StringFlag{Name: "windows-network-networkNamespace", Usage: "specifies network namespace for container"},
cli.StringFlag{Name: "windows-resources-cpu", Usage: "specifies CPU for container"},
cli.Uint64Flag{Name: "windows-resources-memory-limit", Usage: "specifies limit of memory"},
Expand Down Expand Up @@ -935,7 +936,7 @@ func setupSpec(g *generate.Generator, context *cli.Context) error {
}

if context.IsSet("windows-ignore-flushes-during-boot") {
g.SetWinodwsIgnoreFlushesDuringBoot(context.Bool("windows-ignore-flushes-during-boot"))
g.SetWindowsIgnoreFlushesDuringBoot(context.Bool("windows-ignore-flushes-during-boot"))
}

if context.IsSet("windows-layer-folders") {
Expand Down Expand Up @@ -967,6 +968,10 @@ func setupSpec(g *generate.Generator, context *cli.Context) error {
g.SetWindowsNetwork(tmpNetwork)
}

if context.IsSet("windows-network-allowunqualifieddnsquery") {
g.SetWindowsNetworkAllowUnqualifiedDNSQuery(context.Bool("windows-network-allowunqualifieddnsquery"))
}

if context.IsSet("windows-network-networkNamespace") {
g.SetWindowsNetworkNamespace(context.String("windows-network-networkNamespace"))
}
Expand Down Expand Up @@ -995,7 +1000,7 @@ func setupSpec(g *generate.Generator, context *cli.Context) error {
}

if context.IsSet("windows-servicing") {
g.SetWinodwsServicing(context.Bool("windows-servicing"))
g.SetWindowsServicing(context.Bool("windows-servicing"))
}

err := addSeccomp(context, g)
Expand Down
1 change: 1 addition & 0 deletions completions/bash/oci-runtime-tool
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,7 @@ _oci-runtime-tool_generate() {
--process-terminal
--rootfs-readonly
--windows-ignore-flushes-during-boot
--windows-network-allowunqualifieddnsquery
--windows-servicing
"

Expand Down
25 changes: 11 additions & 14 deletions generate/generate.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,8 @@ func New(os string) (generator Generator, err error) {
"cmd",
},
Cwd: `C:\`,
ConsoleSize: &rspec.Box{
Width: 80,
Height: 20,
},
}
config.Windows = &rspec.Windows{
IgnoreFlushesDuringBoot: true,
Network: &rspec.WindowsNetwork{
AllowUnqualifiedDNSQuery: true,
lowenna marked this conversation as resolved.
Show resolved Hide resolved
},
}
config.Windows = &rspec.Windows{}
} else {
config.Root = &rspec.Root{
Path: "rootfs",
Expand Down Expand Up @@ -1706,8 +1697,8 @@ func (g *Generator) SetWindowsHypervUntilityVMPath(path string) {
g.Config.Windows.HyperV.UtilityVMPath = path
}

// SetWinodwsIgnoreFlushesDuringBoot sets g.Config.Winodws.IgnoreFlushesDuringBoot.
func (g *Generator) SetWinodwsIgnoreFlushesDuringBoot(ignore bool) {
// SetWindowsIgnoreFlushesDuringBoot sets g.Config.Windows.IgnoreFlushesDuringBoot.
func (g *Generator) SetWindowsIgnoreFlushesDuringBoot(ignore bool) {
g.initConfigWindows()
g.Config.Windows.IgnoreFlushesDuringBoot = ignore
}
Expand Down Expand Up @@ -1745,6 +1736,12 @@ func (g *Generator) SetWindowsNetwork(network rspec.WindowsNetwork) {
g.Config.Windows.Network = &network
}

// SetWindowsNetworkAllowUnqualifiedDNSQuery sets g.Config.Windows.Network.AllowUnqualifiedDNSQuery
func (g *Generator) SetWindowsNetworkAllowUnqualifiedDNSQuery(setting bool) {
g.initConfigWindowsNetwork()
g.Config.Windows.Network.AllowUnqualifiedDNSQuery = setting
}

// SetWindowsNetworkNamespace sets g.Config.Windows.Network.NetworkNamespace
func (g *Generator) SetWindowsNetworkNamespace(path string) {
g.initConfigWindowsNetwork()
Expand All @@ -1769,8 +1766,8 @@ func (g *Generator) SetWindowsResourcesStorage(storage rspec.WindowsStorageResou
g.Config.Windows.Resources.Storage = &storage
}

// SetWinodwsServicing sets g.Config.Winodws.Servicing.
func (g *Generator) SetWinodwsServicing(servicing bool) {
// SetWindowsServicing sets g.Config.Windows.Servicing.
func (g *Generator) SetWindowsServicing(servicing bool) {
g.initConfigWindows()
g.Config.Windows.Servicing = servicing
}
3 changes: 3 additions & 0 deletions man/oci-runtime-tool-generate.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -552,6 +552,9 @@ read the configuration from `config.json`.
Specifies network for container.
e.g. --windows-network='{"endpointList": ["7a010682-17e0-4455-a838-02e5d9655fe6"],"allowUnqualifiedDNSQuery": true,"DNSSearchList": ["a.com"],"networkSharedContainerName": "containerName", "networkNamespace" : "15010682-17e0-4455-a838-02e5d9655f00"}'

**--windows-network-allowunqualifieddnsquery**=true|false
Whether to allow unqualified DNS queries

**--windows-network-networkNamespace**=""
Specified the network namespace for the container
e.g. --windows-network-networkNamespace '15010682-17e0-4455-a838-02e5d9655f00'
Expand Down