diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2017-11-30 09:37:57 -0500 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2017-12-02 15:32:56 +0000 |
commit | adf8809521733283c364ec7de27c783e324185e8 (patch) | |
tree | 427ed0c858ee54e760d0b3691e61765cd7429098 /libpod/options.go | |
parent | 1f01faf4375b2dc667b2794e4decdf360d6e32b8 (diff) | |
download | podman-adf8809521733283c364ec7de27c783e324185e8.tar.gz podman-adf8809521733283c364ec7de27c783e324185e8.tar.bz2 podman-adf8809521733283c364ec7de27c783e324185e8.zip |
Add NetMode, UTSMode and IPCMode
Allow kpod create/run to create contianers in different network namespaces, uts namespaces and
IPC Namespaces.
This patch just handles the simple join the host, or another containers namespaces.
Lots more work needed to full integrate --net
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Closes: #64
Approved by: mheon
Diffstat (limited to 'libpod/options.go')
-rw-r--r-- | libpod/options.go | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/libpod/options.go b/libpod/options.go index 59141115d..07c25faf9 100644 --- a/libpod/options.go +++ b/libpod/options.go @@ -21,7 +21,7 @@ const ( // MountNamespace represents the mount namespace MountNamespace = "mount" // NetNamespace represents the network namespace - NetNamespace = "net" + NetNamespace = "network" // PIDNamespace represents the PID namespace PIDNamespace = "pid" // UserNamespace represents the user namespace @@ -252,13 +252,26 @@ func WithNoPivotRoot(noPivot bool) RuntimeOption { // Container Creation Options -// WithSELinuxMountLabel sets the mount label for SELinux -func WithSELinuxMountLabel(mountLabel string) CtrCreateOption { +// WithShmDir sets the directory that should be mounted on /dev/shm +func WithShmDir(dir string) CtrCreateOption { return func(ctr *Container) error { if ctr.valid { return ErrCtrFinalized } + ctr.config.ShmDir = dir + return nil + } +} + +// WithSELinuxLabels sets the mount label for SELinux +func WithSELinuxLabels(processLabel, mountLabel string) CtrCreateOption { + return func(ctr *Container) error { + if ctr.valid { + return ErrCtrFinalized + } + + ctr.config.ProcessLabel = processLabel ctr.config.MountLabel = mountLabel return nil } |