mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 03:41:45 +00:00
scheduler: fix panic while removing node from imageStates cache
This commit is contained in:
parent
c861ceb41a
commit
c166743272
2
pkg/scheduler/cache/cache.go
vendored
2
pkg/scheduler/cache/cache.go
vendored
@ -506,7 +506,6 @@ func (cache *schedulerCache) removeNodeImageStates(node *v1.Node) {
|
|||||||
state, ok := cache.imageStates[name]
|
state, ok := cache.imageStates[name]
|
||||||
if ok {
|
if ok {
|
||||||
state.nodes.Delete(node.Name)
|
state.nodes.Delete(node.Name)
|
||||||
}
|
|
||||||
if len(state.nodes) == 0 {
|
if len(state.nodes) == 0 {
|
||||||
// Remove the unused image to make sure the length of
|
// Remove the unused image to make sure the length of
|
||||||
// imageStates represents the total number of different
|
// imageStates represents the total number of different
|
||||||
@ -515,6 +514,7 @@ func (cache *schedulerCache) removeNodeImageStates(node *v1.Node) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (cache *schedulerCache) AddPDB(pdb *policy.PodDisruptionBudget) error {
|
func (cache *schedulerCache) AddPDB(pdb *policy.PodDisruptionBudget) error {
|
||||||
|
Loading…
Reference in New Issue
Block a user