Add SELinux mount option to NewMounter() and MountDevice()

Let volume plugins decide if they want to mount volumes with "-o
context=XYZ" or let the container runtime relabel the volume on container
startup.

Using NewMounter, as it's the call where a volume plugin gets the other MountOptions.
This commit is contained in:
Jan Safranek 2022-02-11 10:48:35 +01:00
parent f2fd9c1c16
commit f99cf5180e

View File

@ -129,6 +129,7 @@ type MounterArgs struct {
FsGroup *int64
FSGroupChangePolicy *v1.PodFSGroupChangePolicy
DesiredSize *resource.Quantity
SELinuxLabel string
}
// Mounter interface provides methods to set up/mount the volume.
@ -262,7 +263,8 @@ type Attacher interface {
// DeviceMounterArgs provides auxiliary, optional arguments to DeviceMounter.
type DeviceMounterArgs struct {
FsGroup *int64
FsGroup *int64
SELinuxLabel string
}
// DeviceMounter can mount a block volume to a global path.