From f99cf5180e020c263d7b0e6954b4bd26bb89a054 Mon Sep 17 00:00:00 2001 From: Jan Safranek Date: Fri, 11 Feb 2022 10:48:35 +0100 Subject: [PATCH] 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. --- pkg/volume/volume.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pkg/volume/volume.go b/pkg/volume/volume.go index f46f7d4876a..75c2d906151 100644 --- a/pkg/volume/volume.go +++ b/pkg/volume/volume.go @@ -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.