summaryrefslogtreecommitdiff
path: root/pkg/spec/spec.go
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2018-07-23 12:37:29 +0200
committerAtomic Bot <atomic-devel@projectatomic.io>2018-07-24 21:50:49 +0000
commit41c7e43b4dbba117d41d82cd8d5c0f004daba21e (patch)
tree15fee619996c847b99e19321485e49308aeec7f6 /pkg/spec/spec.go
parent6f65490e274e5cde5f5cb616719ea27932a764ee (diff)
downloadpodman-41c7e43b4dbba117d41d82cd8d5c0f004daba21e.tar.gz
podman-41c7e43b4dbba117d41d82cd8d5c0f004daba21e.tar.bz2
podman-41c7e43b4dbba117d41d82cd8d5c0f004daba21e.zip
network: support ns: prefix to join existing namespace
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com> Closes: #1145 Approved by: rhatdan
Diffstat (limited to 'pkg/spec/spec.go')
-rw-r--r--pkg/spec/spec.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/pkg/spec/spec.go b/pkg/spec/spec.go
index ada84a87c..acc41f7c5 100644
--- a/pkg/spec/spec.go
+++ b/pkg/spec/spec.go
@@ -346,6 +346,9 @@ func addNetNS(config *CreateConfig, g *generate.Generator) error {
} else if netMode.IsContainer() {
logrus.Debug("Using container netmode")
return nil
+ } else if IsNS(string(netMode)) {
+ logrus.Debug("Using ns netmode")
+ return g.AddOrReplaceLinuxNamespace(spec.NetworkNamespace, NS(string(netMode)))
} else if netMode.IsUserDefined() {
logrus.Debug("Using user defined netmode")
return nil