summaryrefslogtreecommitdiff
path: root/pkg/specgen/namespaces.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-05-26 23:13:40 +0200
committerGitHub <noreply@github.com>2021-05-26 23:13:40 +0200
commitd9eb1269257490dddfae3fde2fe57c3009f94287 (patch)
tree2a05ee02a825f2024fa7151b2514f66cafe330e4 /pkg/specgen/namespaces.go
parent5b4ffc7ba79d0c3ad59cce17500c5a98ea686577 (diff)
parent533d88b6566974c979932bab071e9408580ac7f8 (diff)
downloadpodman-d9eb1269257490dddfae3fde2fe57c3009f94287.tar.gz
podman-d9eb1269257490dddfae3fde2fe57c3009f94287.tar.bz2
podman-d9eb1269257490dddfae3fde2fe57c3009f94287.zip
Merge pull request #10447 from mheon/rootlesscni_default
Add the option of Rootless CNI networking by default
Diffstat (limited to 'pkg/specgen/namespaces.go')
-rw-r--r--pkg/specgen/namespaces.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/pkg/specgen/namespaces.go b/pkg/specgen/namespaces.go
index f665fc0be..80852930a 100644
--- a/pkg/specgen/namespaces.go
+++ b/pkg/specgen/namespaces.go
@@ -253,7 +253,7 @@ func ParseUserNamespace(ns string) (Namespace, error) {
// ParseNetworkNamespace parses a network namespace specification in string
// form.
// Returns a namespace and (optionally) a list of CNI networks to join.
-func ParseNetworkNamespace(ns string) (Namespace, []string, error) {
+func ParseNetworkNamespace(ns string, rootlessDefaultCNI bool) (Namespace, []string, error) {
toReturn := Namespace{}
var cniNetworks []string
// Net defaults to Slirp on rootless
@@ -264,7 +264,11 @@ func ParseNetworkNamespace(ns string) (Namespace, []string, error) {
toReturn.NSMode = FromPod
case ns == "" || ns == string(Default) || ns == string(Private):
if rootless.IsRootless() {
- toReturn.NSMode = Slirp
+ if rootlessDefaultCNI {
+ toReturn.NSMode = Bridge
+ } else {
+ toReturn.NSMode = Slirp
+ }
} else {
toReturn.NSMode = Bridge
}