Skip to content

Commit

Permalink
fix(obcluster): access the first server of zone when there is no server
Browse files Browse the repository at this point in the history
  • Loading branch information
powerfooI committed Mar 13, 2024
1 parent adc0f15 commit 0d4b37b
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions internal/dashboard/business/oceanbase/obcluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down

0 comments on commit 0d4b37b

Please sign in to comment.