Merge pull request #116806 from sourcelliu/improvemap

Improve the performance of map usage
This commit is contained in:
Kubernetes Prow Robot 2023-03-21 11:30:24 -07:00 committed by GitHub
commit 94daf7f4b2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1371,7 +1371,7 @@ func failedPodsBackoffKey(ds *apps.DaemonSet, nodeName string) string {
// Returned pods can't be deleted by PodGCController so they should be deleted by DaemonSetController.
func getUnscheduledPodsWithoutNode(runningNodesList []*v1.Node, nodeToDaemonPods map[string][]*v1.Pod) []string {
var results []string
isNodeRunning := make(map[string]bool)
isNodeRunning := make(map[string]bool, len(runningNodesList))
for _, node := range runningNodesList {
isNodeRunning[node.Name] = true
}