Skip to content

Commit 5cee46f

Browse files
Data Source Now Ignored When Upgrading
A bootstrap Job will now no longer be run if a "pgDataSource" is present in the pgcluster when it is recreated as part of the' "pgo upgrade" process. Specifically, if the "upgrade-in-progress" annotation is present on the pgcluster, then it is assumed the cluster is being recreated a part of a PGO upgrade, and any data source logic is ignored. Issue: [ch12469]
1 parent 66ea1e1 commit 5cee46f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

internal/controller/pgcluster/pgclustercontroller.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,11 @@ func (c *Controller) processNextItem() bool {
121121
// If bootstrapping from an existing data source then attempt to create the pgBackRest repository.
122122
// If a repo already exists (e.g. because it is associated with a currently running cluster) then
123123
// proceed with bootstrapping.
124-
if cluster.Spec.PGDataSource.RestoreFrom != "" {
124+
// Also, if the "upgrading" annotation is present on the pgcluster, assume the cluster has
125+
// already been bootstrapped and is being recreated as part of the upgrade process. More
126+
// specifically, ignore the data source and proceed with adding cluster deployments.
127+
_, upgrading := cluster.Annotations[config.ANNOTATION_UPGRADE_IN_PROGRESS]
128+
if cluster.Spec.PGDataSource.RestoreFrom != "" && !upgrading {
125129
repoCreated, err := clusteroperator.AddBootstrapRepo(c.Client, cluster)
126130
if err != nil {
127131
log.Error(err)

0 commit comments

Comments
 (0)