Skip to content

Commit b6466bd

Browse files
authored
Ensure superfluous label is removed from user labels on upgrade
This removes the "pg-pod-anti-affinity" label from the "userlabels" section of the pgclusters custom resource during the upgrade process. This has long been managed through the custom resource itself and should not be present within the custom labels. Issue: [ch11573]
1 parent 3cfe438 commit b6466bd

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

internal/operator/cluster/upgrade.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,11 @@ func preparePgclusterForUpgrade(pgcluster *crv1.Pgcluster, parameters map[string
561561
}
562562
delete(pgcluster.Spec.UserLabels, "service-type")
563563

564+
// 4.6.0 removed the "pg-pod-anti-affinity" label from user labels, as this is
565+
// superfluous and handled through other processes. We can explicitly
566+
// eliminate it
567+
delete(pgcluster.Spec.UserLabels, "pg-pod-anti-affinity")
568+
564569
// 4.6.0 moved the "autofail" label to the DisableAutofail attribute. Given
565570
// by default we need to start in an autofailover state, we just delete the
566571
// legacy attribute

0 commit comments

Comments
 (0)