add cluster and controller methods for getting status

This commit is contained in:
Murat Kabilov
2017-08-15 12:11:06 +02:00
parent 4ee28e3818
commit 82f58b57d8
4 changed files with 238 additions and 0 deletions
+17
View File
@@ -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,
}
}