summaryrefslogtreecommitdiff
path: root/libpod/options.go
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2018-04-20 18:59:19 +0200
committerAtomic Bot <atomic-devel@projectatomic.io>2018-05-04 17:15:55 +0000
commit73078fabcfd2420c47e41843da71dd993f9a0a3e (patch)
tree1c98d8ae433c5f148c7af5184777d2348b5b2540 /libpod/options.go
parentb51d7379987581da82902027fe91cdf298047bc0 (diff)
downloadpodman-73078fabcfd2420c47e41843da71dd993f9a0a3e.tar.gz
podman-73078fabcfd2420c47e41843da71dd993f9a0a3e.tar.bz2
podman-73078fabcfd2420c47e41843da71dd993f9a0a3e.zip
networking, userNS: configure the network namespace after create
so that the OCI runtime creates the network namespace from the correct userNS. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com> Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #690 Approved by: mheon
Diffstat (limited to 'libpod/options.go')
-rw-r--r--libpod/options.go3
1 files changed, 2 insertions, 1 deletions
diff --git a/libpod/options.go b/libpod/options.go
index eaca70afc..2b3ad2eb4 100644
--- a/libpod/options.go
+++ b/libpod/options.go
@@ -707,7 +707,7 @@ func WithDependencyCtrs(ctrs []*Container) CtrCreateOption {
// namespace with a minimal configuration.
// An optional array of port mappings can be provided.
// Conflicts with WithNetNSFrom().
-func WithNetNS(portMappings []ocicni.PortMapping) CtrCreateOption {
+func WithNetNS(portMappings []ocicni.PortMapping, postConfigureNetNS bool) CtrCreateOption {
return func(ctr *Container) error {
if ctr.valid {
return ErrCtrFinalized
@@ -717,6 +717,7 @@ func WithNetNS(portMappings []ocicni.PortMapping) CtrCreateOption {
return errors.Wrapf(ErrInvalidArg, "container is already set to join another container's net ns, cannot create a new net ns")
}
+ ctr.config.PostConfigureNetNS = postConfigureNetNS
ctr.config.CreateNetNS = true
ctr.config.PortMappings = portMappings