mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
Merge pull request #96105 from lixiaobing1/nodeInfo
fix n to nodeInfo easy to understand
This commit is contained in:
commit
05e5a49e0a
22
pkg/scheduler/internal/cache/cache.go
vendored
22
pkg/scheduler/internal/cache/cache.go
vendored
@ -297,25 +297,25 @@ func (cache *schedulerCache) updateNodeInfoSnapshotList(snapshot *Snapshot, upda
|
|||||||
klog.Error(err)
|
klog.Error(err)
|
||||||
}
|
}
|
||||||
for _, nodeName := range nodesList {
|
for _, nodeName := range nodesList {
|
||||||
if n := snapshot.nodeInfoMap[nodeName]; n != nil {
|
if nodeInfo := snapshot.nodeInfoMap[nodeName]; nodeInfo != nil {
|
||||||
snapshot.nodeInfoList = append(snapshot.nodeInfoList, n)
|
snapshot.nodeInfoList = append(snapshot.nodeInfoList, nodeInfo)
|
||||||
if len(n.PodsWithAffinity) > 0 {
|
if len(nodeInfo.PodsWithAffinity) > 0 {
|
||||||
snapshot.havePodsWithAffinityNodeInfoList = append(snapshot.havePodsWithAffinityNodeInfoList, n)
|
snapshot.havePodsWithAffinityNodeInfoList = append(snapshot.havePodsWithAffinityNodeInfoList, nodeInfo)
|
||||||
}
|
}
|
||||||
if len(n.PodsWithRequiredAntiAffinity) > 0 {
|
if len(nodeInfo.PodsWithRequiredAntiAffinity) > 0 {
|
||||||
snapshot.havePodsWithRequiredAntiAffinityNodeInfoList = append(snapshot.havePodsWithRequiredAntiAffinityNodeInfoList, n)
|
snapshot.havePodsWithRequiredAntiAffinityNodeInfoList = append(snapshot.havePodsWithRequiredAntiAffinityNodeInfoList, nodeInfo)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
klog.Errorf("node %q exist in nodeTree but not in NodeInfoMap, this should not happen.", nodeName)
|
klog.Errorf("node %q exist in nodeTree but not in NodeInfoMap, this should not happen.", nodeName)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for _, n := range snapshot.nodeInfoList {
|
for _, nodeInfo := range snapshot.nodeInfoList {
|
||||||
if len(n.PodsWithAffinity) > 0 {
|
if len(nodeInfo.PodsWithAffinity) > 0 {
|
||||||
snapshot.havePodsWithAffinityNodeInfoList = append(snapshot.havePodsWithAffinityNodeInfoList, n)
|
snapshot.havePodsWithAffinityNodeInfoList = append(snapshot.havePodsWithAffinityNodeInfoList, nodeInfo)
|
||||||
}
|
}
|
||||||
if len(n.PodsWithRequiredAntiAffinity) > 0 {
|
if len(nodeInfo.PodsWithRequiredAntiAffinity) > 0 {
|
||||||
snapshot.havePodsWithRequiredAntiAffinityNodeInfoList = append(snapshot.havePodsWithRequiredAntiAffinityNodeInfoList, n)
|
snapshot.havePodsWithRequiredAntiAffinityNodeInfoList = append(snapshot.havePodsWithRequiredAntiAffinityNodeInfoList, nodeInfo)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user