diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2018-09-01 12:51:00 -0400 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-09-07 18:18:54 +0000 |
commit | 87f90ce14abf36fbf85f6128b3024ea89a44d670 (patch) | |
tree | 7090c0a491c2f4199f8172e1d30b525fa938ed86 /cmd/podman/create.go | |
parent | ccc4a339cd124abc668b7542a9eb838cd7d1b214 (diff) | |
download | podman-87f90ce14abf36fbf85f6128b3024ea89a44d670.tar.gz podman-87f90ce14abf36fbf85f6128b3024ea89a44d670.tar.bz2 podman-87f90ce14abf36fbf85f6128b3024ea89a44d670.zip |
Fix pod sharing for utsmode
We should be sharing cgroups namespace by default in pods
uts namespace sharing was broken in pods.
Create a new libpod/pkg/namespaces for handling of namespace fields
in containers
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Closes: #1418
Approved by: mheon
Diffstat (limited to 'cmd/podman/create.go')
-rw-r--r-- | cmd/podman/create.go | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/cmd/podman/create.go b/cmd/podman/create.go index 20d976c0b..7a3b26c85 100644 --- a/cmd/podman/create.go +++ b/cmd/podman/create.go @@ -16,11 +16,11 @@ import ( ann "github.com/containers/libpod/pkg/annotations" "github.com/containers/libpod/pkg/apparmor" "github.com/containers/libpod/pkg/inspect" + "github.com/containers/libpod/pkg/namespaces" "github.com/containers/libpod/pkg/rootless" cc "github.com/containers/libpod/pkg/spec" "github.com/containers/libpod/pkg/util" libpodVersion "github.com/containers/libpod/version" - "github.com/docker/docker/api/types/container" "github.com/docker/docker/pkg/signal" "github.com/docker/go-connections/nat" "github.com/docker/go-units" @@ -456,7 +456,7 @@ func parseCreateOpts(ctx context.Context, c *cli.Context, runtime *libpod.Runtim if !c.IsSet("pid") && pod != nil && pod.SharesPID() { pidModeStr = cc.POD } - pidMode := container.PidMode(pidModeStr) + pidMode := namespaces.PidMode(pidModeStr) if !cc.Valid(string(pidMode), pidMode) { return nil, errors.Errorf("--pid %q is not valid", c.String("pid")) } @@ -465,7 +465,7 @@ func parseCreateOpts(ctx context.Context, c *cli.Context, runtime *libpod.Runtim if !c.IsSet("userns") && pod != nil && pod.SharesUser() { usernsModeStr = cc.POD } - usernsMode := container.UsernsMode(usernsModeStr) + usernsMode := namespaces.UsernsMode(usernsModeStr) if !cc.Valid(string(usernsMode), usernsMode) { return nil, errors.Errorf("--userns %q is not valid", c.String("userns")) } @@ -474,7 +474,7 @@ func parseCreateOpts(ctx context.Context, c *cli.Context, runtime *libpod.Runtim if !c.IsSet("uts") && pod != nil && pod.SharesUTS() { utsModeStr = cc.POD } - utsMode := container.UTSMode(utsModeStr) + utsMode := namespaces.UTSMode(utsModeStr) if !cc.Valid(string(utsMode), utsMode) { return nil, errors.Errorf("--uts %q is not valid", c.String("uts")) } @@ -483,7 +483,7 @@ func parseCreateOpts(ctx context.Context, c *cli.Context, runtime *libpod.Runtim if !c.IsSet("ipc") && pod != nil && pod.SharesIPC() { ipcModeStr = cc.POD } - ipcMode := container.IpcMode(ipcModeStr) + ipcMode := namespaces.IpcMode(ipcModeStr) if !cc.Valid(string(ipcMode), ipcMode) { return nil, errors.Errorf("--ipc %q is not valid", ipcMode) } @@ -492,7 +492,7 @@ func parseCreateOpts(ctx context.Context, c *cli.Context, runtime *libpod.Runtim netModeStr = cc.POD } // Make sure if network is set to container namespace, port binding is not also being asked for - netMode := container.NetworkMode(netModeStr) + netMode := namespaces.NetworkMode(netModeStr) if netMode.IsContainer() || cc.IsPod(netModeStr) { if len(c.StringSlice("publish")) > 0 || c.Bool("publish-all") { return nil, errors.Errorf("cannot set port bindings on an existing container network namespace") |