Skip to content

Commit f49f235

Browse files
committed
Fix bug where pod cannot roll out when auto-grow is enabled and no volume repo exists.
1 parent b2e4268 commit f49f235

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

internal/controller/postgrescluster/pgbackrest.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1506,7 +1506,7 @@ func (r *Reconciler) reconcilePGBackRest(ctx context.Context,
15061506
// reconcile all pgbackrest repository repos
15071507
replicaCreateRepo, err := r.reconcileRepos(ctx, postgresCluster, configHashes, repoResources)
15081508
if err != nil {
1509-
log.Error(err, "unable to reconcile pgBackRest repo host")
1509+
log.Error(err, "unable to reconcile pgBackRest repos")
15101510
result.Requeue = true
15111511
return result, nil
15121512
}
@@ -2775,7 +2775,7 @@ func (r *Reconciler) reconcileRepos(ctx context.Context,
27752775
repoVols := []*corev1.PersistentVolumeClaim{}
27762776
var replicaCreateRepo v1beta1.PGBackRestRepo
27772777

2778-
if feature.Enabled(ctx, feature.AutoGrowVolumes) {
2778+
if feature.Enabled(ctx, feature.AutoGrowVolumes) && pgbackrest.RepoHostVolumeDefined(postgresCluster) {
27792779
// get the autogrow annotations so that the correct volume size values can be
27802780
// used and the cluster status can be updated
27812781
errors = append(errors, r.writeRepoVolumeSizeRequestStatus(ctx, postgresCluster))

0 commit comments

Comments
 (0)