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:
Oleksii Kliukin
2017-10-23 12:26:59 +02:00
committed by Murat Kabilov
parent c17aabb642
commit 7a76be7d3e
3 changed files with 15 additions and 16 deletions
+2 -1
View File
@@ -69,7 +69,7 @@ func (c *Cluster) serviceName(role PostgresRole) string {
}
func (c *Cluster) podDisruptionBudgetName() string {
return c.OpConfig.PDBNameFormat.Format("cluster", c.Spec.ClusterName)
return c.OpConfig.PDBNameFormat.Format("cluster", c.Name)
}
func (c *Cluster) resourceRequirements(resources spec.Resources) (*v1.ResourceRequirements, error) {
@@ -605,6 +605,7 @@ func (c *Cluster) generatePodDisruptionBudget() *policybeta1.PodDisruptionBudget
ObjectMeta: metav1.ObjectMeta{
Name: c.podDisruptionBudgetName(),
Namespace: c.Namespace,
Labels: c.labelsSet(),
},
Spec: policybeta1.PodDisruptionBudgetSpec{
MinAvailable: &minAvailable,