maintenance: Remove WithWindowsNetworkNamespace from pkg/cri
Old TODO stating that pkg/cri/opts's `WithWindowsNetworkNamespace` should be moved to the main containerd pkg was out of date as thats already been done (well, to the /oci package). This just removes it and swaps all uses of `WithWindowsNetworkNamespace` to the oci packages impl. Signed-off-by: Danny Canter <danny@dcantah.dev>
This commit is contained in:
@@ -32,21 +32,6 @@ import (
|
||||
osinterface "github.com/containerd/containerd/pkg/os"
|
||||
)
|
||||
|
||||
// WithWindowsNetworkNamespace sets windows network namespace for container.
|
||||
// TODO(windows): Move this into container/containerd.
|
||||
func WithWindowsNetworkNamespace(path string) oci.SpecOpts {
|
||||
return func(ctx context.Context, client oci.Client, c *containers.Container, s *runtimespec.Spec) error {
|
||||
if s.Windows == nil {
|
||||
s.Windows = &runtimespec.Windows{}
|
||||
}
|
||||
if s.Windows.Network == nil {
|
||||
s.Windows.Network = &runtimespec.WindowsNetwork{}
|
||||
}
|
||||
s.Windows.Network.NetworkNamespace = path
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
// namedPipePath returns true if the given path is to a named pipe.
|
||||
func namedPipePath(p string) bool {
|
||||
return strings.HasPrefix(p, `\\.\pipe\`)
|
||||
|
||||
Reference in New Issue
Block a user