summaryrefslogtreecommitdiff
path: root/libpod/container_internal.go
diff options
context:
space:
mode:
authorhaircommander <pehunt@redhat.com>2018-07-27 13:58:50 -0400
committerAtomic Bot <atomic-devel@projectatomic.io>2018-08-23 18:16:28 +0000
commitd5e690914dc78eca8664442e7677eb5004522bfd (patch)
tree3f7ed30e4302c871c16126a0032b8a3d51c46f98 /libpod/container_internal.go
parent63dd200e7e47261454c7e55fed2ad972144e147f (diff)
downloadpodman-d5e690914dc78eca8664442e7677eb5004522bfd.tar.gz
podman-d5e690914dc78eca8664442e7677eb5004522bfd.tar.bz2
podman-d5e690914dc78eca8664442e7677eb5004522bfd.zip
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 <pehunt@redhat.com> Closes: #1187 Approved by: mheon
Diffstat (limited to 'libpod/container_internal.go')
-rw-r--r--libpod/container_internal.go35
1 files changed, 0 insertions, 35 deletions
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 {