@@ -32,25 +32,25 @@ import (
3232
3333// Cluster the definition of a cluster.
3434type Cluster struct {
35- ObjectMeta types.ObjectMeta `json:"objectMeta"`
36- TypeMeta types.TypeMeta `json:"typeMeta"`
37- Ready metav1.ConditionStatus `json:"ready"`
38- KubernetesVersion string `json:"kubernetesVersion,omitempty"`
39- SyncMode v1alpha1.ClusterSyncMode `json:"syncMode"`
40- NodeSummary * v1alpha1.NodeSummary `json:"nodeSummary,omitempty"`
41- AllocatedResources ClusterAllocatedResources `json:"allocatedResources"`
35+ ObjectMeta types.ObjectMeta `json:"objectMeta"`
36+ TypeMeta types.TypeMeta `json:"typeMeta"`
37+ Ready metav1.ConditionStatus `json:"ready"`
38+ KubernetesVersion string `json:"kubernetesVersion,omitempty"`
39+ SyncMode v1alpha1.ClusterSyncMode `json:"syncMode"`
40+ NodeSummary * v1alpha1.NodeSummary `json:"nodeSummary,omitempty"`
41+ AllocatedResources AllocatedResources `json:"allocatedResources"`
4242}
4343
44- // ClusterList contains a list of clusters.
45- type ClusterList struct {
44+ // List contains a list of clusters.
45+ type List struct {
4646 ListMeta types.ListMeta `json:"listMeta"`
4747 Clusters []Cluster `json:"clusters"`
4848 // List of non-critical errors, that occurred during resource retrieval.
4949 Errors []error `json:"errors"`
5050}
5151
5252// GetClusterList returns a list of all Nodes in the cluster.
53- func GetClusterList (client karmadaclientset.Interface , dsQuery * dataselect.DataSelectQuery ) (* ClusterList , error ) {
53+ func GetClusterList (client karmadaclientset.Interface , dsQuery * dataselect.Query ) (* List , error ) {
5454 clusters , err := client .ClusterV1alpha1 ().Clusters ().List (context .TODO (), helpers .ListEverything )
5555 nonCriticalErrors , criticalError := errors .ExtractErrors (err )
5656 if criticalError != nil {
@@ -59,8 +59,8 @@ func GetClusterList(client karmadaclientset.Interface, dsQuery *dataselect.DataS
5959 return toClusterList (client , clusters .Items , nonCriticalErrors , dsQuery ), nil
6060}
6161
62- func toClusterList (_ karmadaclientset.Interface , clusters []v1alpha1.Cluster , nonCriticalErrors []error , dsQuery * dataselect.DataSelectQuery ) * ClusterList {
63- clusterList := & ClusterList {
62+ func toClusterList (_ karmadaclientset.Interface , clusters []v1alpha1.Cluster , nonCriticalErrors []error , dsQuery * dataselect.Query ) * List {
63+ clusterList := & List {
6464 Clusters : make ([]Cluster , 0 ),
6565 ListMeta : types.ListMeta {TotalItems : len (clusters )},
6666 Errors : nonCriticalErrors ,
0 commit comments