diff options
author | Matthew Heon <mheon@redhat.com> | 2018-12-04 14:57:06 -0500 |
---|---|---|
committer | Matthew Heon <mheon@redhat.com> | 2018-12-04 14:57:06 -0500 |
commit | 32aa45e344abc3e9501b0fddbac099285869e224 (patch) | |
tree | 671bc653b8efc93ee9b5729ec9414cd9560f14ce /libpod/runtime.go | |
parent | f31c1c8c09c8dd1468093e0d891ff110d48f5461 (diff) | |
download | podman-32aa45e344abc3e9501b0fddbac099285869e224.tar.gz podman-32aa45e344abc3e9501b0fddbac099285869e224.tar.bz2 podman-32aa45e344abc3e9501b0fddbac099285869e224.zip |
Don't initialize CNI when running as rootless
We don't use CNI to configure networks for rootless containers,
so no need to set it up. It may also cause issues with inotify,
so disabling it resolves some potential problems.
Signed-off-by: Matthew Heon <mheon@redhat.com>
Diffstat (limited to 'libpod/runtime.go')
-rw-r--r-- | libpod/runtime.go | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/libpod/runtime.go b/libpod/runtime.go index 9feae03fc..78092536d 100644 --- a/libpod/runtime.go +++ b/libpod/runtime.go @@ -523,11 +523,13 @@ func makeRuntime(runtime *Runtime) (err error) { } // Set up the CNI net plugin - netPlugin, err := ocicni.InitCNI(runtime.config.CNIDefaultNetwork, runtime.config.CNIConfigDir, runtime.config.CNIPluginDir...) - if err != nil { - return errors.Wrapf(err, "error configuring CNI network plugin") + if !rootless.IsRootless() { + netPlugin, err := ocicni.InitCNI(runtime.config.CNIDefaultNetwork, runtime.config.CNIConfigDir, runtime.config.CNIPluginDir...) + if err != nil { + return errors.Wrapf(err, "error configuring CNI network plugin") + } + runtime.netPlugin = netPlugin } - runtime.netPlugin = netPlugin // Set up a firewall backend backendType := "" |