提交 3a38a83d 编写于 作者: J jeff

component status

上级 1b15e5e7
...@@ -64,10 +64,12 @@ func GetComponentStatus(namespace string, componentName string) (interface{}, er ...@@ -64,10 +64,12 @@ func GetComponentStatus(namespace string, componentName string) (interface{}, er
return nil, err return nil, err
} else { } else {
for _, v := range pods.Items { for _, v := range pods.Items {
component.TotalBackends++
component.HealthyBackends++
for _, c := range v.Status.ContainerStatuses { for _, c := range v.Status.ContainerStatuses {
component.TotalBackends++ if !c.Ready {
if c.Ready { component.HealthyBackends--
component.HealthyBackends++ break
} }
} }
} }
...@@ -118,10 +120,12 @@ func GetAllComponentsStatus() (map[string]interface{}, error) { ...@@ -118,10 +120,12 @@ func GetAllComponentsStatus() (map[string]interface{}, error) {
continue continue
} else { } else {
for _, v := range pods.Items { for _, v := range pods.Items {
component.TotalBackends++
component.HealthyBackends++
for _, c := range v.Status.ContainerStatuses { for _, c := range v.Status.ContainerStatuses {
component.TotalBackends++ if !c.Ready {
if c.Ready { component.HealthyBackends--
component.HealthyBackends++ break
} }
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册