Merge pull request #2227 from claire921/refactor_ExpandResourceShortcut

Use switch rather than ifs for getPodStatusForReplicationController
This commit is contained in:
Clayton Coleman 2014-11-07 12:05:56 -05:00
commit 10f6056170

View File

@ -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++
} }
} }