mirror of
https://github.com/containers/podman.git
synced 2025-09-19 12:56:57 +08:00
Fix SELinux labels of volumes
If we attempt to label a volume and the file system does not support labeling, then just warn. SELinux may or may not work, on the volume. There is no way to setup a private label on a newly created volume without using the container mountlabel. If we don't have a mount label at the time of creation of the volume, the only option we have is to create a shared label. Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
@ -85,7 +85,7 @@ func (r *Runtime) newVolume(ctx context.Context, options ...VolumeCreateOption)
|
||||
if err := os.Chown(fullVolPath, volume.config.UID, volume.config.GID); err != nil {
|
||||
return nil, errors.Wrapf(err, "error chowning volume directory %q to %d:%d", fullVolPath, volume.config.UID, volume.config.GID)
|
||||
}
|
||||
if err := LabelVolumePath(fullVolPath, true); err != nil {
|
||||
if err := LabelVolumePath(fullVolPath); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
volume.config.MountPoint = fullVolPath
|
||||
|
Reference in New Issue
Block a user