diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2019-05-16 16:24:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-16 16:24:06 +0200 |
commit | bd21a99501ca088e0fd6a36bc8007c931bc5d5ef (patch) | |
tree | f060e8e2b90a7a502650fe8a76530618fbe18dc5 /libpod/networking_linux.go | |
parent | 2bb1487a00d23bb38314b7d7ee861952b7c6517e (diff) | |
parent | 04aa0d65b018fc0a5bf1c7ddb0407ea01f7c34a6 (diff) | |
download | podman-bd21a99501ca088e0fd6a36bc8007c931bc5d5ef.tar.gz podman-bd21a99501ca088e0fd6a36bc8007c931bc5d5ef.tar.bz2 podman-bd21a99501ca088e0fd6a36bc8007c931bc5d5ef.zip |
Merge pull request #3121 from giuseppe/rootless-error-cni
network: raise a clearer error when using CNI
Diffstat (limited to 'libpod/networking_linux.go')
-rw-r--r-- | libpod/networking_linux.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/libpod/networking_linux.go b/libpod/networking_linux.go index 2450bd6b1..b8a916de3 100644 --- a/libpod/networking_linux.go +++ b/libpod/networking_linux.go @@ -19,6 +19,7 @@ import ( "github.com/containers/libpod/pkg/firewall" "github.com/containers/libpod/pkg/inspect" "github.com/containers/libpod/pkg/netns" + "github.com/containers/libpod/pkg/rootless" "github.com/cri-o/ocicni/pkg/ocicni" "github.com/pkg/errors" "github.com/sirupsen/logrus" @@ -100,6 +101,9 @@ func (r *Runtime) configureNetNS(ctr *Container, ctrNS ns.NetNS) ([]*cnitypes.Re // Create and configure a new network namespace for a container func (r *Runtime) createNetNS(ctr *Container) (n ns.NetNS, q []*cnitypes.Result, err error) { + if rootless.IsRootless() { + return nil, nil, errors.New("cannot configure a new network namespace in rootless mode, only --network=slirp4netns is supported") + } ctrNS, err := netns.NewNS() if err != nil { return nil, nil, errors.Wrapf(err, "error creating network namespace for container %s", ctr.ID()) |