Remove network-cmd-path

As part of slirp removal.
RUN-3569

Signed-off-by: Ashley Cui <acui@redhat.com>
This commit is contained in:
Ashley Cui
2025-10-10 13:53:40 -04:00
parent ac91395e1d
commit aa1d7b189a
7 changed files with 1 additions and 38 deletions

View File

@@ -582,12 +582,6 @@ func rootFlags(cmd *cobra.Command, podmanConfig *entities.PodmanConfig) {
pFlags.StringVar(&podmanConfig.ConmonPath, conmonFlagName, "", "Path of the conmon binary")
_ = cmd.RegisterFlagCompletionFunc(conmonFlagName, completion.AutocompleteDefault)
// TODO (6.0): --network-cmd-path is deprecated, remove this option with the next major release
// We need to find all the places that use r.config.Engine.NetworkCmdPath and remove it
networkCmdPathFlagName := "network-cmd-path"
pFlags.StringVar(&podmanConfig.ContainersConf.Engine.NetworkCmdPath, networkCmdPathFlagName, podmanConfig.ContainersConfDefaultsRO.Engine.NetworkCmdPath, "Path to the command for configuring the network")
_ = cmd.RegisterFlagCompletionFunc(networkCmdPathFlagName, completion.AutocompleteDefault)
networkConfigDirFlagName := "network-config-dir"
pFlags.StringVar(&podmanConfig.ContainersConf.Network.NetworkConfigDir, networkConfigDirFlagName, podmanConfig.ContainersConfDefaultsRO.Network.NetworkConfigDir, "Path of the configuration directory for networks")
_ = cmd.RegisterFlagCompletionFunc(networkConfigDirFlagName, completion.AutocompleteDefault)

View File

@@ -31333,10 +31333,6 @@ msgid ""
"Windows (excluding WSL2) machines"
msgstr ""
#: ../../source/markdown/podman.1.md:98
msgid "**--network-cmd-path**=*path*"
msgstr ""
#: ../../source/markdown/podman.1.md:99
msgid ""
"Path to the `slirp4netns(1)` command binary to use for setting up a "

View File

@@ -104,11 +104,6 @@ Load the specified `containers.conf(5)` module. Can be an absolute or relative
This flag is not supported on the remote client, including Mac and Windows (excluding WSL2) machines.
Further note that the flag is a root-level flag and must be specified before any Podman sub-command.
#### **--network-cmd-path**=*path*
Path to the `slirp4netns(1)` command binary to use for setting up a slirp4netns network.
If "" is used, then the binary will first be searched using the `helper_binaries_dir` option in `containers.conf`, and second using the `$PATH` environment variable.
**Note:** This option is deprecated and will be removed with Podman 6.0. Use the `helper_binaries_dir` option in `containers.conf` instead.
#### **--network-config-dir**=*directory*
Path to the directory where network configuration files are located.

View File

@@ -50,10 +50,7 @@ func (r *Runtime) setPlatformHostInfo(info *define.HostInfo) error {
info.CgroupsVersion = "v2"
slirp4netnsPath := r.config.Engine.NetworkCmdPath
if slirp4netnsPath == "" {
slirp4netnsPath, _ = r.config.FindHelperBinary(slirp4netns.BinaryName, true)
}
slirp4netnsPath, _ := r.config.FindHelperBinary(slirp4netns.BinaryName, true)
if slirp4netnsPath != "" {
ver, err := version.Program(slirp4netnsPath)
if err != nil {

View File

@@ -180,20 +180,6 @@ func WithConmonPath(path string) RuntimeOption {
}
}
// WithNetworkCmdPath specifies the path to the slirp4netns binary which manages the
// runtime.
func WithNetworkCmdPath(path string) RuntimeOption {
return func(rt *Runtime) error {
if rt.valid {
return define.ErrRuntimeFinalized
}
rt.config.Engine.NetworkCmdPath = path
return nil
}
}
// WithNetworkBackend specifies the name of the network backend.
func WithNetworkBackend(name string) RuntimeOption {
return func(rt *Runtime) error {

View File

@@ -164,9 +164,6 @@ func getRuntime(ctx context.Context, fs *flag.FlagSet, opts *engineOpts) (*libpo
if fs.Changed("tmpdir") {
options = append(options, libpod.WithTmpDir(cfg.ContainersConf.Engine.TmpDir))
}
if fs.Changed("network-cmd-path") {
options = append(options, libpod.WithNetworkCmdPath(cfg.ContainersConf.Engine.NetworkCmdPath))
}
if fs.Changed("network-backend") {
options = append(options, libpod.WithNetworkBackend(cfg.ContainersConf.Network.NetworkBackend))
}

View File

@@ -1,7 +1,5 @@
## assert-podman-global-args "network" "--network-cmd-path=/usr/bin/network-cmd"
## assert-podman-global-args "network" "--network-config-dir=/etc/network-config"
## assert-podman-global-args "network" "--log-level=debug"
[Network]
GlobalArgs=--network-cmd-path=/usr/bin/network-cmd
GlobalArgs=--network-config-dir=/etc/network-config --log-level=debug