mirror of
https://github.com/zalando/postgres-operator.git
synced 2026-10-19 02:37:31 +02:00
Minor fixes around PDB (pod-distruption-budget) syncing: (#147)
- Call comparison function in the case of the sync as well as for update - Include full cluster name in PDB name - Assign cluster labels to the PDB object
This commit is contained in:
committed by
Murat Kabilov
parent
c17aabb642
commit
7a76be7d3e
@@ -536,13 +536,9 @@ func (c *Cluster) Update(newSpec *spec.Postgresql) error {
|
||||
c.logger.Infof("volumes have been updated successfully")
|
||||
}
|
||||
|
||||
newPDB := c.generatePodDisruptionBudget()
|
||||
if match, reason := c.samePDBWith(newPDB); !match {
|
||||
c.logPDBChanges(c.PodDisruptionBudget, newPDB, true, reason)
|
||||
if err := c.updatePodDisruptionBudget(newPDB); err != nil {
|
||||
c.setStatus(spec.ClusterStatusUpdateFailed)
|
||||
return fmt.Errorf("could not update pod disruption budget: %v", err)
|
||||
}
|
||||
if err := c.syncPodDisruptionBudget(true); err != nil {
|
||||
c.setStatus(spec.ClusterStatusUpdateFailed)
|
||||
return fmt.Errorf("could not update pod disruption budget: %v", err)
|
||||
}
|
||||
|
||||
c.setStatus(spec.ClusterStatusRunning)
|
||||
|
||||
Reference in New Issue
Block a user