mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-26 05:03:09 +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
|
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++
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user