simplify PostgresClusterStatus string comparison
This commit is contained in:
		
							parent
							
								
									407a05086e
								
							
						
					
					
						commit
						9f3ed38643
					
				|  | @ -173,7 +173,7 @@ func (c *Cluster) setStatus(status acidv1.PostgresClusterStatus) { | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| func (c *Cluster) isNewCluster() bool { | 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.
 | // initUsers populates c.systemUsers and c.pgUsers maps.
 | ||||||
|  |  | ||||||
|  | @ -28,7 +28,7 @@ func (c *Cluster) Sync(newSpec *acidv1.Postgresql) error { | ||||||
| 		if err != nil { | 		if err != nil { | ||||||
| 			c.logger.Warningf("error while syncing cluster state: %v", err) | 			c.logger.Warningf("error while syncing cluster state: %v", err) | ||||||
| 			c.setStatus(acidv1.ClusterStatusSyncFailed) | 			c.setStatus(acidv1.ClusterStatusSyncFailed) | ||||||
| 		} else if (c.Status != acidv1.PostgresStatus{PostgresClusterStatus: acidv1.ClusterStatusRunning}) { | 		} else if c.Status.PostgresClusterStatus != acidv1.ClusterStatusRunning { | ||||||
| 			c.setStatus(acidv1.ClusterStatusRunning) | 			c.setStatus(acidv1.ClusterStatusRunning) | ||||||
| 		} | 		} | ||||||
| 	}() | 	}() | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue