summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2019-10-24 21:29:53 +0200
committerGitHub <noreply@github.com>2019-10-24 21:29:53 +0200
commit77c7a28a7213344e1ce56b5bc7c95b46805c9d9b (patch)
tree7cdb87760403ce2de4c940bca3b62782f3b93f68 /libpod
parentba4a808fe7ca10ed0581239624623f9ea85773ec (diff)
parent8f75b3e8c95ae21fab16e4564a7056def82df649 (diff)
downloadpodman-77c7a28a7213344e1ce56b5bc7c95b46805c9d9b.tar.gz
podman-77c7a28a7213344e1ce56b5bc7c95b46805c9d9b.tar.bz2
podman-77c7a28a7213344e1ce56b5bc7c95b46805c9d9b.zip
Merge pull request #4333 from giuseppe/error-rootless-cni
rootless: raise an error with --network=
Diffstat (limited to 'libpod')
-rw-r--r--libpod/options.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/libpod/options.go b/libpod/options.go
index 17a075d2d..f779b0413 100644
--- a/libpod/options.go
+++ b/libpod/options.go
@@ -1014,6 +1014,13 @@ func WithNetNS(portMappings []ocicni.PortMapping, postConfigureNetNS bool, netmo
ctr.config.NetMode = namespaces.NetworkMode(netmode)
ctr.config.CreateNetNS = true
ctr.config.PortMappings = portMappings
+
+ if rootless.IsRootless() {
+ if len(networks) > 0 {
+ return errors.New("cannot use CNI networks with rootless containers")
+ }
+ }
+
ctr.config.Networks = networks
return nil