mirror of
https://github.com/containers/podman.git
synced 2025-07-02 16:57:24 +08:00
Begin wiring in USERNS Support into podman
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com> Closes: #690 Approved by: mheon
This commit is contained in:

committed by
Atomic Bot

parent
1f5debd438
commit
b51d737998
@ -59,7 +59,7 @@ func (metadata *RuntimeContainerMetadata) SetMountLabel(mountLabel string) {
|
||||
|
||||
// CreateContainerStorage creates the storage end of things. We already have the container spec created
|
||||
// TO-DO We should be passing in an Image object in the future.
|
||||
func (r *storageService) CreateContainerStorage(ctx context.Context, systemContext *types.SystemContext, imageName, imageID, containerName, containerID, mountLabel string) (ContainerInfo, error) {
|
||||
func (r *storageService) CreateContainerStorage(ctx context.Context, systemContext *types.SystemContext, imageName, imageID, containerName, containerID, mountLabel string, options *storage.ContainerOptions) (ContainerInfo, error) {
|
||||
var ref types.ImageReference
|
||||
if imageName == "" && imageID == "" {
|
||||
return ContainerInfo{}, ErrEmptyID
|
||||
@ -111,13 +111,15 @@ func (r *storageService) CreateContainerStorage(ctx context.Context, systemConte
|
||||
// Build the container.
|
||||
names := []string{containerName}
|
||||
|
||||
options := storage.ContainerOptions{
|
||||
IDMappingOptions: storage.IDMappingOptions{
|
||||
HostUIDMapping: true,
|
||||
HostGIDMapping: true,
|
||||
},
|
||||
if options == nil {
|
||||
options = &storage.ContainerOptions{
|
||||
IDMappingOptions: storage.IDMappingOptions{
|
||||
HostUIDMapping: true,
|
||||
HostGIDMapping: true,
|
||||
},
|
||||
}
|
||||
}
|
||||
container, err := r.store.CreateContainer(containerID, names, img.ID, "", string(mdata), &options)
|
||||
container, err := r.store.CreateContainer(containerID, names, img.ID, "", string(mdata), options)
|
||||
if err != nil {
|
||||
logrus.Debugf("failed to create container %s(%s): %v", metadata.ContainerName, containerID, err)
|
||||
|
||||
|
Reference in New Issue
Block a user