mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-07 15:23:47 +02:00
add cluster and controller methods for getting status
This commit is contained in:
@@ -644,3 +644,20 @@ func (c *Cluster) initInfrastructureRoles() error {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// GetStatus provides status of the cluster
|
||||
func (c *Cluster) GetStatus() *spec.ClusterStatus {
|
||||
return &spec.ClusterStatus{
|
||||
Cluster: c.Spec.ClusterName,
|
||||
Team: c.Spec.TeamID,
|
||||
Status: c.Status,
|
||||
Spec: c.Spec,
|
||||
|
||||
MasterService: c.GetServiceMaster(),
|
||||
ReplicaService: c.GetServiceReplica(),
|
||||
Endpoint: c.GetEndpoint(),
|
||||
StatefulSet: c.GetStatefulSet(),
|
||||
|
||||
Error: c.Error,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user