diff options
author | Giuseppe Scrivano <gscrivan@redhat.com> | 2018-11-21 17:38:28 +0100 |
---|---|---|
committer | Giuseppe Scrivano <gscrivan@redhat.com> | 2018-11-27 21:10:16 +0100 |
commit | 4203df69aca13f14e43ad32a9b7ffb6cfb8c1016 (patch) | |
tree | b1d255b5b9b92fa400b1a38a99694609501e4dbf /pkg/namespaces/namespaces.go | |
parent | 266c4952a89be89b1741f9fa69443f51387dd5c6 (diff) | |
download | podman-4203df69aca13f14e43ad32a9b7ffb6cfb8c1016.tar.gz podman-4203df69aca13f14e43ad32a9b7ffb6cfb8c1016.tar.bz2 podman-4203df69aca13f14e43ad32a9b7ffb6cfb8c1016.zip |
rootless: add new netmode "slirp4netns"
so that inspect reports the correct network configuration.
Closes: https://github.com/containers/libpod/issues/1453
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Diffstat (limited to 'pkg/namespaces/namespaces.go')
-rw-r--r-- | pkg/namespaces/namespaces.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/pkg/namespaces/namespaces.go b/pkg/namespaces/namespaces.go index bee833fa9..832efd554 100644 --- a/pkg/namespaces/namespaces.go +++ b/pkg/namespaces/namespaces.go @@ -223,7 +223,12 @@ func (n NetworkMode) IsBridge() bool { return n == "bridge" } +// IsSlirp4netns indicates if we are running a rootless network stack +func (n NetworkMode) IsSlirp4netns() bool { + return n == "slirp4netns" +} + // IsUserDefined indicates user-created network func (n NetworkMode) IsUserDefined() bool { - return !n.IsDefault() && !n.IsBridge() && !n.IsHost() && !n.IsNone() && !n.IsContainer() + return !n.IsDefault() && !n.IsBridge() && !n.IsHost() && !n.IsNone() && !n.IsContainer() && !n.IsSlirp4netns() } |