mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-26 21:17:23 +00:00
Use read lock for PendingPods
This commit is contained in:
parent
9c2df998af
commit
4b4c20be7c
@ -702,8 +702,8 @@ func (p *PriorityQueue) NominatedPodsForNode(nodeName string) []*v1.Pod {
|
|||||||
// PendingPods returns all the pending pods in the queue. This function is
|
// PendingPods returns all the pending pods in the queue. This function is
|
||||||
// used for debugging purposes in the scheduler cache dumper and comparer.
|
// used for debugging purposes in the scheduler cache dumper and comparer.
|
||||||
func (p *PriorityQueue) PendingPods() []*v1.Pod {
|
func (p *PriorityQueue) PendingPods() []*v1.Pod {
|
||||||
p.lock.Lock()
|
p.lock.RLock()
|
||||||
defer p.lock.Unlock()
|
defer p.lock.RUnlock()
|
||||||
result := []*v1.Pod{}
|
result := []*v1.Pod{}
|
||||||
for _, pInfo := range p.activeQ.List() {
|
for _, pInfo := range p.activeQ.List() {
|
||||||
result = append(result, pInfo.(*podInfo).pod)
|
result = append(result, pInfo.(*podInfo).pod)
|
||||||
|
Loading…
Reference in New Issue
Block a user