fix slow component status api

This commit is contained in:
Jeff
2019-11-04 16:57:52 +08:00
committed by zryfish
parent 24cbc083b0
commit 6dcf1e4cda

View File

@@ -19,12 +19,9 @@ package components
import (
"fmt"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/klog"
"kubesphere.io/kubesphere/pkg/models"
"kubesphere.io/kubesphere/pkg/simple/client"
"kubesphere.io/kubesphere/pkg/informers"
"kubesphere.io/kubesphere/pkg/models"
corev1 "k8s.io/api/core/v1"
"k8s.io/apimachinery/pkg/labels"
@@ -93,12 +90,6 @@ func GetSystemHealthStatus() (*models.HealthStatus, error) {
status := &models.HealthStatus{}
componentStatuses, err := client.ClientSets().K8s().Kubernetes().CoreV1().ComponentStatuses().List(metav1.ListOptions{})
if err != nil {
return nil, err
}
status.KubernetesComponents = append(status.KubernetesComponents, componentStatuses.Items...)
// get kubesphere-system components
components, err := GetAllComponentsStatus()
if err != nil {