summaryrefslogtreecommitdiff
path: root/libpod/container_internal.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2018-10-18 15:50:11 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2018-10-23 10:57:23 -0400
commita95d71f1135165ae51c28b49275e5a3948fbbd2b (patch)
tree09a1a17d28799e0ebf409c45f80d1b01985717ac /libpod/container_internal.go
parent57b0b89d0ceb77bfd51a4d957f51fcea3d1580f6 (diff)
downloadpodman-a95d71f1135165ae51c28b49275e5a3948fbbd2b.tar.gz
podman-a95d71f1135165ae51c28b49275e5a3948fbbd2b.tar.bz2
podman-a95d71f1135165ae51c28b49275e5a3948fbbd2b.zip
Allow containers/storage to handle on SELinux labeling
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'libpod/container_internal.go')
-rw-r--r--libpod/container_internal.go16
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