Remove duplicate and unused index from PodIndexer

DaemonSetsController adds a "nodeName" index to PodIndexer, which is
redundant with the "spec.nodeName" index of NodeLifecycleController.
However, DaemonSetsController hasn't been using this index since #86730.
This patch removes the redundant and unused index to reduce memory and
CPU spent on it.

Signed-off-by: Quan Tian <qtian@vmware.com>
This commit is contained in:
Quan Tian
2022-08-02 01:16:23 +08:00
parent d46742b387
commit f40067a8cc
2 changed files with 1 additions and 22 deletions

View File

@@ -2234,9 +2234,8 @@ func TestNodeShouldRunDaemonPod(t *testing.T) {
}
manager.nodeStore.Add(node)
for _, p := range c.podsOnNode {
manager.podStore.Add(p)
p.Spec.NodeName = "test-node"
manager.podNodeIndex.Add(p)
manager.podStore.Add(p)
}
c.ds.Spec.UpdateStrategy = *strategy
shouldRun, shouldContinueRunning := NodeShouldRunDaemonPod(node, c.ds)