Use switch rather than ifs for getPodStatusForReplicationController in pkg/describe.go

This commit is contained in:
Claire Li 2014-11-06 23:11:21 -08:00
parent b6956506fa
commit a4261d0f65

View File

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