diff --git a/internal/dashboard/business/oceanbase/obcluster.go b/internal/dashboard/business/oceanbase/obcluster.go index f5154fc58..1d8318016 100644 --- a/internal/dashboard/business/oceanbase/obcluster.go +++ b/internal/dashboard/business/oceanbase/obcluster.go @@ -148,21 +148,24 @@ func buildOBClusterResponse(ctx context.Context, obcluster *v1alpha1.OBCluster) Value: toleration.Value, }) } - - topology = append(topology, response.OBZone{ + respZone := response.OBZone{ Namespace: obzone.Namespace, Name: obzone.Name, Zone: obzone.Spec.Topology.Zone, Replicas: obzone.Spec.Topology.Replica, Status: convertStatus(obzone.Status.Status), StatusDetail: obzone.Status.Status, + RootService: "", // TODO: query real rs - RootService: obzone.Status.OBServerStatus[0].Server, OBServers: observers, NodeSelector: nodeSelector, Affinities: affinities, Tolerations: tolerations, - }) + } + if len(obzone.Status.OBServerStatus) > 0 { + respZone.RootService = obzone.Status.OBServerStatus[0].Server + } + topology = append(topology, respZone) } respCluster := &response.OBCluster{