1
0
mirror of https://github.com/containers/podman.git synced 2026-02-05 06:45:31 +01:00

Remove CNI backend configuration from runtime

Remove runtime configuration options for CNI network backend:

Runtime options:
- Remove WithNetworkBackend() runtime option function
- Function allowed setting network backend programmatically

Flag handling:
- Remove --network-backend flag change detection
- Remove call to WithNetworkBackend() when flag changed
- Remove TODO comment about CNI plugins directory flag

The network backend configuration is now handled entirely by the
vendored common/libnetwork code, which will default to Netavark.
There is no longer any way to configure CNI as the network backend
through Podman's runtime initialization.

Note: libpod/info.go keeps existing NetworkBackend reporting logic
which will automatically report "netavark" as the only backend since
configuration defaults to netavark and cannot be changed to CNI.

Signed-off-by: Lokesh Mandvekar <lsm5@redhat.com>
This commit is contained in:
Lokesh Mandvekar
2025-12-25 14:10:11 -05:00
parent 73ef7cfcdc
commit f6bddc8af2
2 changed files with 0 additions and 18 deletions

View File

@@ -180,19 +180,6 @@ func WithConmonPath(path string) RuntimeOption {
}
}
// WithNetworkBackend specifies the name of the network backend.
func WithNetworkBackend(name string) RuntimeOption {
return func(rt *Runtime) error {
if rt.valid {
return define.ErrRuntimeFinalized
}
rt.config.Network.NetworkBackend = name
return nil
}
}
// WithCgroupManager specifies the manager implementation name which is used to
// handle cgroups for containers.
// Current valid values are "cgroupfs" and "systemd".

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-backend") {
options = append(options, libpod.WithNetworkBackend(cfg.ContainersConf.Network.NetworkBackend))
}
if fs.Changed("events-backend") {
options = append(options, libpod.WithEventsLogger(cfg.ContainersConf.Engine.EventsLogger))
@@ -208,8 +205,6 @@ func getRuntime(ctx context.Context, fs *flag.FlagSet, opts *engineOpts) (*libpo
options = append(options, libpod.WithStaticDir(opts.config.ContainersConfDefaultsRO.Engine.StaticDir))
}
// TODO flag to set CNI plugins dir?
if !opts.withFDS {
options = append(options, libpod.WithEnableSDNotify())
}