diff --git a/pkg/cluster/cluster.go b/pkg/cluster/cluster.go index fad3f0a79..c5b6335de 100644 --- a/pkg/cluster/cluster.go +++ b/pkg/cluster/cluster.go @@ -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. diff --git a/pkg/cluster/sync.go b/pkg/cluster/sync.go index 272347d01..3f32d7ba8 100644 --- a/pkg/cluster/sync.go +++ b/pkg/cluster/sync.go @@ -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) } }()