diff options
author | Giuseppe Scrivano <gscrivan@redhat.com> | 2019-03-05 11:46:47 +0100 |
---|---|---|
committer | Giuseppe Scrivano <gscrivan@redhat.com> | 2019-03-11 09:29:04 +0100 |
commit | e02393ba700907ae193190f7335d3f2ec83c442a (patch) | |
tree | b9603c6fa65ed55e1bc746d777f5ce1896a62cf1 /libpod/options.go | |
parent | 349e6911497a95a6a8121524b56704fe680f2b09 (diff) | |
download | podman-e02393ba700907ae193190f7335d3f2ec83c442a.tar.gz podman-e02393ba700907ae193190f7335d3f2ec83c442a.tar.bz2 podman-e02393ba700907ae193190f7335d3f2ec83c442a.zip |
libpod: allow to configure path to the network-cmd binary
allow to configure the path to the network-cmd binary, either via an
option flag --network-cmd-path or through the libpod.conf
configuration file.
This is currently used to customize the path to the slirp4netns
binary.
Closes: https://github.com/containers/libpod/issues/2506
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'libpod/options.go')
-rw-r--r-- | libpod/options.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/libpod/options.go b/libpod/options.go index 5ad2824d9..64b425c57 100644 --- a/libpod/options.go +++ b/libpod/options.go @@ -193,6 +193,20 @@ func WithConmonEnv(environment []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 ErrRuntimeFinalized + } + + rt.config.NetworkCmdPath = path + + return nil + } +} + // WithCgroupManager specifies the manager implementation name which is used to // handle cgroups for containers. // Current valid values are "cgroupfs" and "systemd". |