Add SELinuxMount feature gate

The feature gate enables mounting with -o context=XYZ mount option for all
volume types, not only ReadWriteOncePod.

All SELinux label tracking & error reporting infrastructure is already in
place from SELinuxMountReadWriteOncePod feature gate. This is just a
trivial extension to all access modes.
This commit is contained in:
Jan Safranek
2024-02-06 13:35:56 +01:00
parent 2016fab308
commit d7028a8ed5
4 changed files with 47 additions and 2 deletions

View File

@@ -449,6 +449,9 @@ type VolumeToMount struct {
DesiredPersistentVolumeSize resource.Quantity
// SELinux label that should be used to mount.
// The label is set when:
// * SELinuxMountReadWriteOncePod feature gate is enabled and the volume is RWOP and kubelet knows the SELinux label.
// * Or, SELinuxMount feature gate is enabled and kubelet knows the SELinux label.
SELinuxLabel string
}