From d5e690914dc78eca8664442e7677eb5004522bfd Mon Sep 17 00:00:00 2001 From: haircommander Date: Fri, 27 Jul 2018 13:58:50 -0400 Subject: Added option to share kernel namespaces in libpod and podman A pause container is added to the pod if the user opts in. The default pause image and command can be overridden. Pause containers are ignored in ps unless the -a option is present. Pod inspect and pod ps show shared namespaces and pause container. A pause container can't be removed with podman rm, and a pod can be removed if it only has a pause container. Signed-off-by: haircommander Closes: #1187 Approved by: mheon --- libpod/container_internal.go | 35 ----------------------------------- 1 file changed, 35 deletions(-) (limited to 'libpod/container_internal.go') diff --git a/libpod/container_internal.go b/libpod/container_internal.go index 32036ca7a..e276e0194 100644 --- a/libpod/container_internal.go +++ b/libpod/container_internal.go @@ -11,7 +11,6 @@ import ( "path/filepath" "strings" "syscall" - "time" "github.com/containers/libpod/pkg/chrootuser" "github.com/containers/libpod/pkg/hooks" @@ -23,13 +22,11 @@ import ( "github.com/containers/storage/pkg/archive" "github.com/containers/storage/pkg/chrootarchive" "github.com/containers/storage/pkg/mount" - "github.com/containers/storage/pkg/stringid" spec "github.com/opencontainers/runtime-spec/specs-go" "github.com/opencontainers/runtime-tools/generate" "github.com/opencontainers/selinux/go-selinux/label" "github.com/pkg/errors" "github.com/sirupsen/logrus" - "github.com/ulule/deepcopier" "golang.org/x/text/language" ) @@ -174,38 +171,6 @@ func (c *Container) syncContainer() error { return nil } -// Make a new container -func newContainer(rspec *spec.Spec, lockDir string) (*Container, error) { - if rspec == nil { - return nil, errors.Wrapf(ErrInvalidArg, "must provide a valid runtime spec to create container") - } - - ctr := new(Container) - ctr.config = new(ContainerConfig) - ctr.state = new(containerState) - - ctr.config.ID = stringid.GenerateNonCryptoID() - - ctr.config.Spec = new(spec.Spec) - deepcopier.Copy(rspec).To(ctr.config.Spec) - ctr.config.CreatedTime = time.Now() - - ctr.config.ShmSize = DefaultShmSize - - ctr.state.BindMounts = make(map[string]string) - - // Path our lock file will reside at - lockPath := filepath.Join(lockDir, ctr.config.ID) - // Grab a lockfile at the given path - lock, err := storage.GetLockfile(lockPath) - if err != nil { - return nil, errors.Wrapf(err, "error creating lockfile for new container") - } - ctr.lock = lock - - return ctr, nil -} - // Create container root filesystem for use func (c *Container) setupStorage(ctx context.Context) error { if !c.valid { -- cgit v1.2.3-54-g00ecf