OCI Modifiers for Windows
Signed-off-by: John Howard <jhoward@microsoft.com> Needed for the containerd work on Windows and integrating the oci package from containerd into moby. No longer sets defaults for - .Process.ConsoleSize - .Windows.IgnoreFlushesDuringBoot - .Windows.Network.AllowUnqualifiedDNSQuery Adds helper functions and tests for - WithWindowsIgnoreFlushesDuringBoot - WithWindowNetworksAllowUnqualifiedDNSQuery Updates `ctr run` on Windows to use the new helper functions, ConsoleSize is already handled.
This commit is contained in:
@@ -39,3 +39,29 @@ func WithWindowsCPUCount(count uint64) SpecOpts {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// WithWindowsIgnoreFlushesDuringBoot sets `Windows.IgnoreFlushesDuringBoot`.
|
||||
func WithWindowsIgnoreFlushesDuringBoot() SpecOpts {
|
||||
return func(_ context.Context, _ Client, _ *containers.Container, s *Spec) error {
|
||||
if s.Windows == nil {
|
||||
s.Windows = &specs.Windows{}
|
||||
}
|
||||
s.Windows.IgnoreFlushesDuringBoot = true
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// WithWindowNetworksAllowUnqualifiedDNSQuery sets `Windows.IgnoreFlushesDuringBoot`.
|
||||
func WithWindowNetworksAllowUnqualifiedDNSQuery() SpecOpts {
|
||||
return func(_ context.Context, _ Client, _ *containers.Container, s *Spec) error {
|
||||
if s.Windows == nil {
|
||||
s.Windows = &specs.Windows{}
|
||||
}
|
||||
if s.Windows.Network == nil {
|
||||
s.Windows.Network = &specs.WindowsNetwork{}
|
||||
}
|
||||
|
||||
s.Windows.Network.AllowUnqualifiedDNSQuery = true
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user