From 3ff3ed4b6d8b6f6d3a4cf0dae23cc67fe5ecd226 Mon Sep 17 00:00:00 2001 From: Jan Safranek Date: Tue, 5 Nov 2024 12:59:42 +0100 Subject: [PATCH] Add comment how GetPodsForCSIDriver is useful --- pkg/controller/volume/selinuxwarning/cache/volumecache.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/controller/volume/selinuxwarning/cache/volumecache.go b/pkg/controller/volume/selinuxwarning/cache/volumecache.go index 661f5cc3a0b..df8b1169e59 100644 --- a/pkg/controller/volume/selinuxwarning/cache/volumecache.go +++ b/pkg/controller/volume/selinuxwarning/cache/volumecache.go @@ -38,6 +38,10 @@ type VolumeCache interface { DeletePod(logger klog.Logger, podKey cache.ObjectName) // GetPodsForCSIDriver returns all pods that use volumes with the given CSI driver. + // This is useful when a CSIDrive changes its spec.seLinuxMount and the controller + // needs to reevaluate all pods that use volumes with this driver. + // The controller doesn't need to track in-tree volume plugins, because they don't + // change their SELinux support dynamically. GetPodsForCSIDriver(driverName string) []cache.ObjectName // SendConflicts sends all current conflicts to the given channel.