Skip to content

Commit 428e7d6

Browse files
author
John Howard
committed
Windows: Typos and incorrect defaults
Signed-off-by: John Howard <[email protected]>
1 parent f611b4e commit 428e7d6

File tree

3 files changed

+21
-16
lines changed

3 files changed

+21
-16
lines changed

cmd/oci-runtime-tool/generate.go

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

937938
if context.IsSet("windows-ignore-flushes-during-boot") {
938-
g.SetWinodwsIgnoreFlushesDuringBoot(context.Bool("windows-ignore-flushes-during-boot"))
939+
g.SetWindowsIgnoreFlushesDuringBoot(context.Bool("windows-ignore-flushes-during-boot"))
939940
}
940941

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

971+
if context.IsSet("windows-network-allowunqualifieddnsquery") {
972+
g.SetWindowsNetworkAllowUnqualifiedDNSQuery(context.Bool("windows-network-allowunqualifieddnsquery"))
973+
}
974+
970975
if context.IsSet("windows-network-networkNamespace") {
971976
g.SetWindowsNetworkNamespace(context.String("windows-network-networkNamespace"))
972977
}
@@ -995,7 +1000,7 @@ func setupSpec(g *generate.Generator, context *cli.Context) error {
9951000
}
9961001

9971002
if context.IsSet("windows-servicing") {
998-
g.SetWinodwsServicing(context.Bool("windows-servicing"))
1003+
g.SetWindowsServicing(context.Bool("windows-servicing"))
9991004
}
10001005

10011006
err := addSeccomp(context, g)

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",
@@ -1706,8 +1697,8 @@ func (g *Generator) SetWindowsHypervUntilityVMPath(path string) {
17061697
g.Config.Windows.HyperV.UtilityVMPath = path
17071698
}
17081699

1709-
// SetWinodwsIgnoreFlushesDuringBoot sets g.Config.Winodws.IgnoreFlushesDuringBoot.
1710-
func (g *Generator) SetWinodwsIgnoreFlushesDuringBoot(ignore bool) {
1700+
// SetWindowsIgnoreFlushesDuringBoot sets g.Config.Windows.IgnoreFlushesDuringBoot.
1701+
func (g *Generator) SetWindowsIgnoreFlushesDuringBoot(ignore bool) {
17111702
g.initConfigWindows()
17121703
g.Config.Windows.IgnoreFlushesDuringBoot = ignore
17131704
}
@@ -1745,6 +1736,12 @@ func (g *Generator) SetWindowsNetwork(network rspec.WindowsNetwork) {
17451736
g.Config.Windows.Network = &network
17461737
}
17471738

1739+
// SetWindowsNetworkAllowUnqualifiedDNSQuery sets g.Config.Windows.Network.AllowUnqualifiedDNSQuery
1740+
func (g *Generator) SetWindowsNetworkAllowUnqualifiedDNSQuery(setting bool) {
1741+
g.initConfigWindowsNetwork()
1742+
g.Config.Windows.Network.AllowUnqualifiedDNSQuery = setting
1743+
}
1744+
17481745
// SetWindowsNetworkNamespace sets g.Config.Windows.Network.NetworkNamespace
17491746
func (g *Generator) SetWindowsNetworkNamespace(path string) {
17501747
g.initConfigWindowsNetwork()
@@ -1769,8 +1766,8 @@ func (g *Generator) SetWindowsResourcesStorage(storage rspec.WindowsStorageResou
17691766
g.Config.Windows.Resources.Storage = &storage
17701767
}
17711768

1772-
// SetWinodwsServicing sets g.Config.Winodws.Servicing.
1773-
func (g *Generator) SetWinodwsServicing(servicing bool) {
1769+
// SetWindowsServicing sets g.Config.Windows.Servicing.
1770+
func (g *Generator) SetWindowsServicing(servicing bool) {
17741771
g.initConfigWindows()
17751772
g.Config.Windows.Servicing = servicing
17761773
}

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

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

555+
**--windows-network-allowunqualifieddnsquery**=true|false
556+
Whether to allow unqualified DNS queries
557+
555558
**--windows-network-networkNamespace**=""
556559
Specified the network namespace for the container
557560
e.g. --windows-network-networkNamespace '15010682-17e0-4455-a838-02e5d9655f00'

0 commit comments

Comments
 (0)