simplify PostgresClusterStatus string comparison

This commit is contained in:
Felix Kunde 2019-04-10 15:00:46 +02:00
parent 407a05086e
commit 9f3ed38643
2 changed files with 2 additions and 2 deletions

View File

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

View File

@ -28,7 +28,7 @@ func (c *Cluster) Sync(newSpec *acidv1.Postgresql) error {
if err != nil {
c.logger.Warningf("error while syncing cluster state: %v", err)
c.setStatus(acidv1.ClusterStatusSyncFailed)
} else if (c.Status != acidv1.PostgresStatus{PostgresClusterStatus: acidv1.ClusterStatusRunning}) {
} else if c.Status.PostgresClusterStatus != acidv1.ClusterStatusRunning {
c.setStatus(acidv1.ClusterStatusRunning)
}
}()