mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-21 00:26:09 +02:00
Use /status subresource instead of plain manifest field (#534)
* turns PostgresStatus type into a struct with field PostgresClusterStatus * setStatus patch target is now /status subresource * unmarshalling PostgresStatus takes care of previous status field convention * new simple bool functions status.Running(), status.Creating()
This commit is contained in:
@@ -85,12 +85,22 @@ func validateCloneClusterDescription(clone *CloneDescription) error {
|
||||
}
|
||||
|
||||
// Success of the current Status
|
||||
func (status PostgresStatus) Success() bool {
|
||||
return status != ClusterStatusAddFailed &&
|
||||
status != ClusterStatusUpdateFailed &&
|
||||
status != ClusterStatusSyncFailed
|
||||
func (postgresStatus PostgresStatus) Success() bool {
|
||||
return postgresStatus.PostgresClusterStatus != ClusterStatusAddFailed &&
|
||||
postgresStatus.PostgresClusterStatus != ClusterStatusUpdateFailed &&
|
||||
postgresStatus.PostgresClusterStatus != ClusterStatusSyncFailed
|
||||
}
|
||||
|
||||
func (status PostgresStatus) String() string {
|
||||
return string(status)
|
||||
// Running status of cluster
|
||||
func (postgresStatus PostgresStatus) Running() bool {
|
||||
return postgresStatus.PostgresClusterStatus == ClusterStatusRunning
|
||||
}
|
||||
|
||||
// Creating status of cluster
|
||||
func (postgresStatus PostgresStatus) Creating() bool {
|
||||
return postgresStatus.PostgresClusterStatus == ClusterStatusCreating
|
||||
}
|
||||
|
||||
func (postgresStatus PostgresStatus) String() string {
|
||||
return postgresStatus.PostgresClusterStatus
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user