From a4261d0f65e3cbe10711aad6f291c7ae7d3650ea Mon Sep 17 00:00:00 2001 From: Claire Li Date: Thu, 6 Nov 2014 23:11:21 -0800 Subject: [PATCH] Use switch rather than ifs for getPodStatusForReplicationController in pkg/describe.go --- pkg/kubectl/describe.go | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pkg/kubectl/describe.go b/pkg/kubectl/describe.go index 8e8ae09a76d..f1e0b823f6b 100644 --- a/pkg/kubectl/describe.go +++ b/pkg/kubectl/describe.go @@ -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++ } }