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:
@@ -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)
|
||||
|
Reference in New Issue
Block a user