Skip to content

Commit bcea291

Browse files
author
Zhou Hao
authored
Merge pull request #683 from jhowardmsft/jjh/windowsdefaults
Windows: Typos and incorrect defaults
2 parents 5ed6852 + 3bc60a4 commit bcea291

File tree

4 files changed

+22
-16
lines changed

4 files changed

+22
-16
lines changed

cmd/oci-runtime-tool/generate.go

+7-2
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ var generateFlags = []cli.Flag{
141141
cli.BoolFlag{Name: "windows-ignore-flushes-during-boot", Usage: "ignore flushes during boot"},
142142
cli.StringSliceFlag{Name: "windows-layer-folders", Usage: "specifies a list of layer folders the container image relies on"},
143143
cli.StringFlag{Name: "windows-network", Usage: "specifies network for container"},
144+
cli.BoolFlag{Name: "windows-network-allowunqualifieddnsquery", Usage: "specifies networking unqualified DNS query is allowed"},
144145
cli.StringFlag{Name: "windows-network-networkNamespace", Usage: "specifies network namespace for container"},
145146
cli.StringFlag{Name: "windows-resources-cpu", Usage: "specifies CPU for container"},
146147
cli.Uint64Flag{Name: "windows-resources-memory-limit", Usage: "specifies limit of memory"},
@@ -940,7 +941,7 @@ func setupSpec(g *generate.Generator, context *cli.Context) error {
940941
}
941942

942943
if context.IsSet("windows-ignore-flushes-during-boot") {
943-
g.SetWinodwsIgnoreFlushesDuringBoot(context.Bool("windows-ignore-flushes-during-boot"))
944+
g.SetWindowsIgnoreFlushesDuringBoot(context.Bool("windows-ignore-flushes-during-boot"))
944945
}
945946

946947
if context.IsSet("windows-layer-folders") {
@@ -972,6 +973,10 @@ func setupSpec(g *generate.Generator, context *cli.Context) error {
972973
g.SetWindowsNetwork(tmpNetwork)
973974
}
974975

976+
if context.IsSet("windows-network-allowunqualifieddnsquery") {
977+
g.SetWindowsNetworkAllowUnqualifiedDNSQuery(context.Bool("windows-network-allowunqualifieddnsquery"))
978+
}
979+
975980
if context.IsSet("windows-network-networkNamespace") {
976981
g.SetWindowsNetworkNamespace(context.String("windows-network-networkNamespace"))
977982
}
@@ -1000,7 +1005,7 @@ func setupSpec(g *generate.Generator, context *cli.Context) error {
10001005
}
10011006

10021007
if context.IsSet("windows-servicing") {
1003-
g.SetWinodwsServicing(context.Bool("windows-servicing"))
1008+
g.SetWindowsServicing(context.Bool("windows-servicing"))
10041009
}
10051010

10061011
err := addSeccomp(context, g)

completions/bash/oci-runtime-tool

+1
Original file line numberDiff line numberDiff line change
@@ -436,6 +436,7 @@ _oci-runtime-tool_generate() {
436436
--process-terminal
437437
--rootfs-readonly
438438
--windows-ignore-flushes-during-boot
439+
--windows-network-allowunqualifieddnsquery
439440
--windows-servicing
440441
"
441442

generate/generate.go

+11-14
Original file line numberDiff line numberDiff line change
@@ -54,17 +54,8 @@ func New(os string) (generator Generator, err error) {
5454
"cmd",
5555
},
5656
Cwd: `C:\`,
57-
ConsoleSize: &rspec.Box{
58-
Width: 80,
59-
Height: 20,
60-
},
61-
}
62-
config.Windows = &rspec.Windows{
63-
IgnoreFlushesDuringBoot: true,
64-
Network: &rspec.WindowsNetwork{
65-
AllowUnqualifiedDNSQuery: true,
66-
},
6757
}
58+
config.Windows = &rspec.Windows{}
6859
} else {
6960
config.Root = &rspec.Root{
7061
Path: "rootfs",
@@ -1712,8 +1703,8 @@ func (g *Generator) SetWindowsHypervUntilityVMPath(path string) {
17121703
g.Config.Windows.HyperV.UtilityVMPath = path
17131704
}
17141705

1715-
// SetWinodwsIgnoreFlushesDuringBoot sets g.Config.Winodws.IgnoreFlushesDuringBoot.
1716-
func (g *Generator) SetWinodwsIgnoreFlushesDuringBoot(ignore bool) {
1706+
// SetWindowsIgnoreFlushesDuringBoot sets g.Config.Windows.IgnoreFlushesDuringBoot.
1707+
func (g *Generator) SetWindowsIgnoreFlushesDuringBoot(ignore bool) {
17171708
g.initConfigWindows()
17181709
g.Config.Windows.IgnoreFlushesDuringBoot = ignore
17191710
}
@@ -1751,6 +1742,12 @@ func (g *Generator) SetWindowsNetwork(network rspec.WindowsNetwork) {
17511742
g.Config.Windows.Network = &network
17521743
}
17531744

1745+
// SetWindowsNetworkAllowUnqualifiedDNSQuery sets g.Config.Windows.Network.AllowUnqualifiedDNSQuery
1746+
func (g *Generator) SetWindowsNetworkAllowUnqualifiedDNSQuery(setting bool) {
1747+
g.initConfigWindowsNetwork()
1748+
g.Config.Windows.Network.AllowUnqualifiedDNSQuery = setting
1749+
}
1750+
17541751
// SetWindowsNetworkNamespace sets g.Config.Windows.Network.NetworkNamespace
17551752
func (g *Generator) SetWindowsNetworkNamespace(path string) {
17561753
g.initConfigWindowsNetwork()
@@ -1775,8 +1772,8 @@ func (g *Generator) SetWindowsResourcesStorage(storage rspec.WindowsStorageResou
17751772
g.Config.Windows.Resources.Storage = &storage
17761773
}
17771774

1778-
// SetWinodwsServicing sets g.Config.Winodws.Servicing.
1779-
func (g *Generator) SetWinodwsServicing(servicing bool) {
1775+
// SetWindowsServicing sets g.Config.Windows.Servicing.
1776+
func (g *Generator) SetWindowsServicing(servicing bool) {
17801777
g.initConfigWindows()
17811778
g.Config.Windows.Servicing = servicing
17821779
}

man/oci-runtime-tool-generate.1.md

+3
Original file line numberDiff line numberDiff line change
@@ -555,6 +555,9 @@ read the configuration from `config.json`.
555555
Specifies network for container.
556556
e.g. --windows-network='{"endpointList": ["7a010682-17e0-4455-a838-02e5d9655fe6"],"allowUnqualifiedDNSQuery": true,"DNSSearchList": ["a.com"],"networkSharedContainerName": "containerName", "networkNamespace" : "15010682-17e0-4455-a838-02e5d9655f00"}'
557557

558+
**--windows-network-allowunqualifieddnsquery**=true|false
559+
Whether to allow unqualified DNS queries
560+
558561
**--windows-network-networkNamespace**=""
559562
Specified the network namespace for the container
560563
e.g. --windows-network-networkNamespace '15010682-17e0-4455-a838-02e5d9655f00'

0 commit comments

Comments
 (0)