mirror of
https://github.com/k3s-io/kubernetes.git
synced 2026-01-06 16:06:51 +00:00
Solved the test problem and added update comment
This commit is contained in:
@@ -700,14 +700,17 @@ func (npm *nominator) AddNominatedPod(pi *framework.PodInfo, nodeName string) {
|
||||
npm.Unlock()
|
||||
}
|
||||
|
||||
// NominatedPodsForNode returns pods that are nominated to run on the given node,
|
||||
// NominatedPodsForNode returns a copy of pods that are nominated to run on the given node,
|
||||
// but they are waiting for other pods to be removed from the node.
|
||||
func (npm *nominator) NominatedPodsForNode(nodeName string) []*framework.PodInfo {
|
||||
npm.RLock()
|
||||
defer npm.RUnlock()
|
||||
// TODO: we may need to return a copy of []*Pods to avoid modification
|
||||
// on the caller side.
|
||||
return npm.nominatedPods[nodeName]
|
||||
// Make a copy of the nominated Pods so the caller can mutate safely.
|
||||
pods := make([]*framework.PodInfo, len(npm.nominatedPods[nodeName]))
|
||||
for i := 0; i < len(pods); i++ {
|
||||
pods[i] = npm.nominatedPods[nodeName][i].DeepCopy()
|
||||
}
|
||||
return pods
|
||||
}
|
||||
|
||||
func (p *PriorityQueue) podsCompareBackoffCompleted(podInfo1, podInfo2 interface{}) bool {
|
||||
|
||||
Reference in New Issue
Block a user