summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2018-11-28 06:18:28 -0800
committerGitHub <noreply@github.com>2018-11-28 06:18:28 -0800
commitd346996e1512ef6efb3800d6cb762d0409d12459 (patch)
treea5f9496bffe3df5a46627f56c0fee08aafdfee55 /cmd
parent2a496aea30da4bbe4981753c11ed095867202466 (diff)
parent95f22a2ca055d6dec0281cee109375dc4fd9b78b (diff)
downloadpodman-d346996e1512ef6efb3800d6cb762d0409d12459.tar.gz
podman-d346996e1512ef6efb3800d6cb762d0409d12459.tar.bz2
podman-d346996e1512ef6efb3800d6cb762d0409d12459.zip
Merge pull request #1849 from giuseppe/report-rootless-netmode
rootless: add new netmode "slirp4netns"
Diffstat (limited to 'cmd')
-rw-r--r--cmd/podman/common.go10
1 files changed, 9 insertions, 1 deletions
diff --git a/cmd/podman/common.go b/cmd/podman/common.go
index f9e746b28..c4016698a 100644
--- a/cmd/podman/common.go
+++ b/cmd/podman/common.go
@@ -11,6 +11,7 @@ import (
"github.com/containers/buildah"
"github.com/containers/libpod/libpod"
+ "github.com/containers/libpod/pkg/rootless"
"github.com/containers/storage"
"github.com/fatih/camelcase"
"github.com/pkg/errors"
@@ -161,6 +162,13 @@ func getContext() context.Context {
return context.TODO()
}
+func getDefaultNetwork() string {
+ if rootless.IsRootless() {
+ return "slirp4netns"
+ }
+ return "bridge"
+}
+
// Common flags shared between commands
var createFlags = []cli.Flag{
cli.StringSliceFlag{
@@ -372,7 +380,7 @@ var createFlags = []cli.Flag{
cli.StringFlag{
Name: "net, network",
Usage: "Connect a container to a network",
- Value: "bridge",
+ Value: getDefaultNetwork(),
},
cli.BoolFlag{
Name: "oom-kill-disable",