mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-06 10:43:56 +00:00
Merge pull request #2227 from claire921/refactor_ExpandResourceShortcut
Use switch rather than ifs for getPodStatusForReplicationController
This commit is contained in:
commit
10f6056170
@ -222,13 +222,14 @@ func getPodStatusForReplicationController(c client.PodInterface, controller *api
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
for _, pod := range rcPods.Items {
|
for _, pod := range rcPods.Items {
|
||||||
if pod.CurrentState.Status == api.PodRunning {
|
switch pod.CurrentState.Status {
|
||||||
|
case api.PodRunning:
|
||||||
running++
|
running++
|
||||||
} else if pod.CurrentState.Status == api.PodPending {
|
case api.PodPending:
|
||||||
waiting++
|
waiting++
|
||||||
} else if pod.CurrentState.Status == api.PodSucceeded {
|
case api.PodSucceeded:
|
||||||
succeeded++
|
succeeded++
|
||||||
} else if pod.CurrentState.Status == api.PodFailed {
|
case api.PodFailed:
|
||||||
failed++
|
failed++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user