Add a comment why PVC indexer is used

This commit is contained in:
Jan Safranek 2024-11-05 13:05:07 +01:00
parent 3ff3ed4b6d
commit cf7a2c7d35

View File

@ -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)