mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-30 23:15:14 +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
|
||||
}
|
||||
for _, pod := range rcPods.Items {
|
||||
if pod.CurrentState.Status == api.PodRunning {
|
||||
switch pod.CurrentState.Status {
|
||||
case api.PodRunning:
|
||||
running++
|
||||
} else if pod.CurrentState.Status == api.PodPending {
|
||||
case api.PodPending:
|
||||
waiting++
|
||||
} else if pod.CurrentState.Status == api.PodSucceeded {
|
||||
case api.PodSucceeded:
|
||||
succeeded++
|
||||
} else if pod.CurrentState.Status == api.PodFailed {
|
||||
case api.PodFailed:
|
||||
failed++
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user