From e30e2440be12c3f2082d2f2262e532f6aaa5fdec Mon Sep 17 00:00:00 2001 From: Armando Ruocco Date: Mon, 19 Oct 2026 13:44:41 +0200 Subject: [PATCH] test(e2e): take the replica cluster backup on the primary After the replica cluster is promoted, the operator recreates its standby to apply configuration changes that need a restart. The backup taken right after the promotion has no target, so it runs on the standby when one is ready, and fails when the operator deletes that pod during the backup. This made the switchover specs flaky in CI. Target the primary, as the source cluster backup already does. Signed-off-by: Armando Ruocco --- test/e2e/internal/tests/replicacluster/fixtures.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/e2e/internal/tests/replicacluster/fixtures.go b/test/e2e/internal/tests/replicacluster/fixtures.go index 2f0ef4858..148466999 100644 --- a/test/e2e/internal/tests/replicacluster/fixtures.go +++ b/test/e2e/internal/tests/replicacluster/fixtures.go @@ -222,6 +222,10 @@ func newReplicaBackup(namespace string) *cloudnativepgv1.Backup { PluginConfiguration: &cloudnativepgv1.BackupPluginConfiguration{ Name: "barman-cloud.cloudnative-pg.io", }, + // Right after the promotion the operator recreates the standby to + // apply configuration changes that need a restart: a backup taken + // there would die with the pod. + Target: "primary", }, } }