mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-03 09:22:44 +00:00
optimize podKiller for reading channel
This commit is contained in:
parent
4fdde68f78
commit
5d19daa2e2
@ -2107,11 +2107,13 @@ func (kl *Kubelet) podKiller() {
|
|||||||
for {
|
for {
|
||||||
select {
|
select {
|
||||||
case podPair, ok := <-kl.podKillingCh:
|
case podPair, ok := <-kl.podKillingCh:
|
||||||
runningPod := podPair.RunningPod
|
|
||||||
apiPod := podPair.APIPod
|
|
||||||
if !ok {
|
if !ok {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
runningPod := podPair.RunningPod
|
||||||
|
apiPod := podPair.APIPod
|
||||||
|
|
||||||
if killing.Has(string(runningPod.ID)) {
|
if killing.Has(string(runningPod.ID)) {
|
||||||
// The pod is already being killed.
|
// The pod is already being killed.
|
||||||
break
|
break
|
||||||
|
Loading…
Reference in New Issue
Block a user