mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Use switch rather than ifs for getPodStatusForReplicationController in pkg/describe.go
This commit is contained in:
parent
b6956506fa
commit
a4261d0f65
@ -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