Skip to content

Commit

Permalink
Use switch rather than ifs for getPodStatusForReplicationController i…
Browse files Browse the repository at this point in the history
…n pkg/describe.go
  • Loading branch information
claire921 committed Nov 7, 2014
1 parent b695650 commit a4261d0
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions pkg/kubectl/describe.go
Original file line number Diff line number Diff line change
Expand Up @@ -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++
}
}
Expand Down

0 comments on commit a4261d0

Please sign in to comment.