From af797bd6f0f2342b83b7e1e16efc2bc361330867 Mon Sep 17 00:00:00 2001 From: Ashley Cui Date: Fri, 19 Dec 2025 16:06:56 -0500 Subject: [PATCH] Remove network-cmd-path config As part of slirp removal RUN-3569 Signed-off-by: Ashley Cui --- common/docs/containers.conf.5.md | 4 ---- common/libnetwork/slirp4netns/slirp4netns.go | 11 ++++------- common/pkg/config/config.go | 3 --- common/pkg/config/containers.conf | 4 ---- common/pkg/config/containers.conf-freebsd | 4 ---- 5 files changed, 4 insertions(+), 22 deletions(-) diff --git a/common/docs/containers.conf.5.md b/common/docs/containers.conf.5.md index c0d9d5489b..1ee6221a44 100644 --- a/common/docs/containers.conf.5.md +++ b/common/docs/containers.conf.5.md @@ -779,10 +779,6 @@ create new containers and pods in that namespace. The default namespace is "", which corresponds to no namespace. When no namespace is set, all containers and pods are visible. -**network_cmd_path**="" - -Path to the slirp4netns binary. - **network_cmd_options**=[] Default options to pass to the slirp4netns binary. diff --git a/common/libnetwork/slirp4netns/slirp4netns.go b/common/libnetwork/slirp4netns/slirp4netns.go index 083a4e5fcc..397f55f505 100644 --- a/common/libnetwork/slirp4netns/slirp4netns.go +++ b/common/libnetwork/slirp4netns/slirp4netns.go @@ -245,13 +245,10 @@ func createBasicSlirpCmdArgs(options *networkOptions, features *slirpFeatures) ( // Setup can be called in rootful as well as in rootless. // Spawns the slirp4netns process and setup port forwarding if ports are given. func Setup(opts *SetupOptions) (*SetupResult, error) { - path := opts.Config.Engine.NetworkCmdPath - if path == "" { - var err error - path, err = opts.Config.FindHelperBinary(BinaryName, true) - if err != nil { - return nil, fmt.Errorf("could not find slirp4netns, the network namespace can't be configured: %w", err) - } + var err error + path, err := opts.Config.FindHelperBinary(BinaryName, true) + if err != nil { + return nil, fmt.Errorf("could not find slirp4netns, the network namespace can't be configured: %w", err) } syncR, syncW, err := os.Pipe() diff --git a/common/pkg/config/config.go b/common/pkg/config/config.go index ae0587f7b7..51fa71056e 100644 --- a/common/pkg/config/config.go +++ b/common/pkg/config/config.go @@ -404,9 +404,6 @@ type EngineConfig struct { // containers and pods will be visible. The default namespace is "". Namespace string `toml:"namespace,omitempty"` - // NetworkCmdPath is the path to the slirp4netns binary. - NetworkCmdPath string `toml:"network_cmd_path,omitempty"` - // NetworkCmdOptions is the default options to pass to the slirp4netns binary. // For example "allow_host_loopback=true" NetworkCmdOptions attributedstring.Slice `toml:"network_cmd_options,omitempty"` diff --git a/common/pkg/config/containers.conf b/common/pkg/config/containers.conf index d89827d3f5..afd9ef72d4 100644 --- a/common/pkg/config/containers.conf +++ b/common/pkg/config/containers.conf @@ -670,10 +670,6 @@ default_sysctls = [ # #namespace = "" -# Path to the slirp4netns binary -# -#network_cmd_path = "" - # Default options to pass to the slirp4netns binary. # Valid options values are: # diff --git a/common/pkg/config/containers.conf-freebsd b/common/pkg/config/containers.conf-freebsd index 6a8163066e..53894bb133 100644 --- a/common/pkg/config/containers.conf-freebsd +++ b/common/pkg/config/containers.conf-freebsd @@ -503,10 +503,6 @@ default_sysctls = [ # #namespace = "" -# Path to the slirp4netns binary -# -#network_cmd_path = "" - # Default options to pass to the slirp4netns binary. # Valid options values are: #