summaryrefslogtreecommitdiff
path: root/libpod/container_validate.go
diff options
context:
space:
mode:
authorAkihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>2020-08-26 18:07:51 +0900
committerAkihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>2020-09-09 15:47:38 +0900
commitf82abc774a70419bc7a2ff444a323110e1d9d938 (patch)
treea4dc3b5d7be2eb9473db3d089e9238ce2a3ef1d8 /libpod/container_validate.go
parentd34868a1366d49b56e8127973147c076c99a8a80 (diff)
downloadpodman-f82abc774a70419bc7a2ff444a323110e1d9d938.tar.gz
podman-f82abc774a70419bc7a2ff444a323110e1d9d938.tar.bz2
podman-f82abc774a70419bc7a2ff444a323110e1d9d938.zip
rootless: support `podman network create` (CNI-in-slirp4netns)
Usage: ``` $ podman network create foo $ podman run -d --name web --hostname web --network foo nginx:alpine $ podman run --rm --network foo alpine wget -O - http://web.dns.podman Connecting to web.dns.podman (10.88.4.6:80) ... <h1>Welcome to nginx!</h1> ... ``` See contrib/rootless-cni-infra for the design. Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
Diffstat (limited to 'libpod/container_validate.go')
-rw-r--r--libpod/container_validate.go11
1 files changed, 0 insertions, 11 deletions
diff --git a/libpod/container_validate.go b/libpod/container_validate.go
index d657e3549..b78168cd1 100644
--- a/libpod/container_validate.go
+++ b/libpod/container_validate.go
@@ -2,7 +2,6 @@ package libpod
import (
"github.com/containers/podman/v2/libpod/define"
- "github.com/containers/podman/v2/pkg/rootless"
spec "github.com/opencontainers/runtime-spec/specs-go"
"github.com/pkg/errors"
)
@@ -68,16 +67,6 @@ func (c *Container) validate() error {
}
}
- // Rootless has some requirements, compared to networks.
- if rootless.IsRootless() {
- if len(c.config.Networks) > 0 {
- return errors.Wrapf(define.ErrInvalidArg, "cannot join CNI networks if running rootless")
- }
-
- // TODO: Should we make sure network mode is set to Slirp if set
- // at all?
- }
-
// Can only set static IP or MAC is creating a network namespace.
if !c.config.CreateNetNS && (c.config.StaticIP != nil || c.config.StaticMAC != nil) {
return errors.Wrapf(define.ErrInvalidArg, "cannot set static IP or MAC address if not creating a network namespace")