diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2018-10-23 09:22:12 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-23 09:22:12 -0700 |
commit | 8ff974248084f752d328d7a8d1cd6af2959bc3fd (patch) | |
tree | 06e527e0f1c8b1736d6af2c1bb53d2e856099872 /libpod/container_internal.go | |
parent | c019830a750d3c2cdb20d2568c9e0f9fdc35165e (diff) | |
parent | a95d71f1135165ae51c28b49275e5a3948fbbd2b (diff) | |
download | podman-8ff974248084f752d328d7a8d1cd6af2959bc3fd.tar.gz podman-8ff974248084f752d328d7a8d1cd6af2959bc3fd.tar.bz2 podman-8ff974248084f752d328d7a8d1cd6af2959bc3fd.zip |
Merge pull request #1687 from rhatdan/vendor
Move selinux label reservations to containers storage.
Diffstat (limited to 'libpod/container_internal.go')
-rw-r--r-- | libpod/container_internal.go | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go index 40159194f..cb6b940fd 100644 --- a/libpod/container_internal.go +++ b/libpod/container_internal.go @@ -194,12 +194,18 @@ func (c *Container) setupStorage(ctx context.Context) error { return errors.Wrapf(ErrInvalidArg, "must provide image ID and image name to use an image") } - var options *storage.ContainerOptions - if c.config.Rootfs == "" { - options = &storage.ContainerOptions{c.config.IDMappings} + options := storage.ContainerOptions{ + IDMappingOptions: storage.IDMappingOptions{ + HostUIDMapping: true, + HostGIDMapping: true, + }, + LabelOpts: c.config.LabelOpts, + } + if c.config.Rootfs == "" { + options.IDMappingOptions = c.config.IDMappings } - containerInfo, err := c.runtime.storageService.CreateContainerStorage(ctx, c.runtime.imageContext, c.config.RootfsImageName, c.config.RootfsImageID, c.config.Name, c.config.ID, c.config.MountLabel, options) + containerInfo, err := c.runtime.storageService.CreateContainerStorage(ctx, c.runtime.imageContext, c.config.RootfsImageName, c.config.RootfsImageID, c.config.Name, c.config.ID, options) if err != nil { return errors.Wrapf(err, "error creating container storage") } @@ -225,6 +231,8 @@ func (c *Container) setupStorage(ctx context.Context) error { } } + c.config.ProcessLabel = containerInfo.ProcessLabel + c.config.MountLabel = containerInfo.MountLabel c.config.StaticDir = containerInfo.Dir c.state.RunDir = containerInfo.RunDir c.state.DestinationRunDir = c.state.RunDir |