From cf7a2c7d35ce0ff0dc00054264e30bf02c8133e8 Mon Sep 17 00:00:00 2001 From: Jan Safranek Date: Tue, 5 Nov 2024 13:05:07 +0100 Subject: [PATCH] Add a comment why PVC indexer is used --- .../volume/selinuxwarning/selinux_warning_controller.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pkg/controller/volume/selinuxwarning/selinux_warning_controller.go b/pkg/controller/volume/selinuxwarning/selinux_warning_controller.go index c45e61f3314..b214c7cc72e 100644 --- a/pkg/controller/volume/selinuxwarning/selinux_warning_controller.go +++ b/pkg/controller/volume/selinuxwarning/selinux_warning_controller.go @@ -128,6 +128,8 @@ func NewController( c.csiTranslator = csiTranslator c.cmpm = csimigration.NewPluginManager(csiTranslator, utilfeature.DefaultFeatureGate) + // Index pods by its PVC keys. Then we don't need to iterate all pods every time to find + // pods which reference given PVC. err = common.AddPodPVCIndexerIfNotPresent(c.podIndexer) if err != nil { return nil, fmt.Errorf("could not initialize SELinux warning controller: %w", err)