add creating method for PostgresStatus

This commit is contained in:
Felix Kunde 2019-04-12 16:36:50 +02:00
parent b9d5cfe6b8
commit 24559e42d1
2 changed files with 6 additions and 1 deletions

View File

@ -96,6 +96,11 @@ 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 fmt.Sprintf(`status=%s`, postgresStatus.PostgresClusterStatus)
}

View File

@ -173,7 +173,7 @@ func (c *Cluster) setStatus(status string) {
}
func (c *Cluster) isNewCluster() bool {
return c.Status.PostgresClusterStatus == acidv1.ClusterStatusCreating
return c.Status.Creating()
}
// initUsers populates c.systemUsers and c.pgUsers maps.