Skip to content

test(e2e): cover backups through plugin-barman-cloud - #10850

Merged
mnencia merged 19 commits into
mainfrom
dev/backup-plugin-test
Jul 7, 2026
Merged

mnencia merged 19 commits into
mainfrom
dev/backup-plugin-test

Conversation

@armru

@armru armru commented Jun 8, 2026 •

Copy link
Copy Markdown
Member

In-core Barman Cloud support is deprecated in favour of the Barman Cloud plugin, so the e2e suite needs to cover backups taken through the plugin. The plugin follows its own release cycle, so the build to test is chosen at invocation time: the latest release, the current main, or a pinned version when reproducing an issue.

On kind and k3d, once the operator is up, the suite installs cert-manager (a plugin prerequisite) and the Barman Cloud plugin into cnpg-system, defaulting to the latest plugin release; the resolved operator and plugin versions are printed at the start of the run.

The suite then covers, through the plugin:

  • a smoke round-trip: a cluster archives through the plugin, the operator reports it as loaded, and a backup is taken, restored into a new cluster via the externalClusters plugin source, and verified
  • a replica cluster bootstrapped from a plugin backup, then streaming from the source
  • tablespaces surviving a backup and restore round-trip
  • a plugin-backed cluster across an in-place operator upgrade, with a backup taken through the plugin afterwards
  • a ScheduledBackup with the immediate option, a prefer-standby backup target verified to run on a replica, and a point-in-time recovery from an external cluster definition

The in-core variants stay until the in-core support is removed; their clusters are shared with volume-snapshot scenarios that have no plugin counterpart yet. The new specs use a dedicated plugin-barman-cloud label: "plugin" already selects the kubectl-cnpg tests, whose certificate spec restarts the operator and would fail anything running alongside it.

cert-manager is now installed on every kind/k3d e2e run; its version is Renovate-tracked. The operator under test stays the local build by default.

To pick the plugin build a run validates, pass barman_plugin (alias bp) to the /test command on a pull request — /test barman_plugin=release (the default), /test bp=main, or /test bp=v0.12.0 for a pinned version — or set the barman_plugin workflow_dispatch input to the same value. Locally, the equivalent is BARMAN_PLUGIN_VERSION=main ./hack/e2e/run-e2e-local.sh.

@armru
armru requested a review from a team June 8, 2026 15:50
@armru

armru commented Jun 8, 2026

Copy link
Copy Markdown
Member Author

/test

@cnpg-bot cnpg-bot added backport-requested ◀️ This pull request should be backported to all supported releases release-1.25 release-1.28 labels Jun 8, 2026
@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

❗ By default, the pull request is configured to backport to all release branches.

  • To stop backporting this pr, remove the label: backport-requested ◀️ or add the label 'do not backport'
  • To stop backporting this pr to a certain release branch, remove the specific branch label: release-x.y

@github-actions

github-actions Bot commented Jun 8, 2026

Copy link
Copy Markdown
Contributor

@armru armru added no-issue do not backport This PR must not be backported - it will be in the next minor release and removed backport-requested ◀️ This pull request should be backported to all supported releases release-1.25 release-1.28 labels Jun 8, 2026
@armru
armru force-pushed the dev/backup-plugin-test branch from 539611d to 217888d Compare June 8, 2026 16:07
@cnpg-bot cnpg-bot added the ok to merge 👌 This PR can be merged label Jun 8, 2026
@armru
armru force-pushed the dev/backup-plugin-test branch from 217888d to a4b9cc4 Compare June 9, 2026 07:43
@dosubot dosubot Bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Jun 9, 2026
@armru

armru commented Jun 9, 2026

Copy link
Copy Markdown
Member Author

/test bp=main

@armru

armru commented Jun 9, 2026

Copy link
Copy Markdown
Member Author

/test

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

@armru

armru commented Jun 9, 2026

Copy link
Copy Markdown
Member Author

/test bp=v0.12.0

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

@armru

armru commented Jun 9, 2026

Copy link
Copy Markdown
Member Author

/test bp=main

@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

@armru
armru force-pushed the dev/backup-plugin-test branch from e56613c to c4d8744 Compare June 9, 2026 16:21
mnencia added 2 commits July 6, 2026 22:49
ensure_cert_manager skipped installing whenever the cert-manager
namespace existed, regardless of whether the manifest apply that
creates it had actually completed. A namespace left over from an
interrupted prior run would make it skip straight to waiting on
Deployments that were never created. Check for the Deployment itself
so a partial install re-applies instead of requiring manual cleanup.

Signed-off-by: Marco Nenciarini <[email protected]>
_github_auth_header's return value was interpolated inline via
-H "\$(_github_auth_header)" at each curl call site. Since this file
is sourced into scripts that turn on "set -x" under DEBUG=true, the
token would appear in the traced command line. Fold it into a
_curl_github wrapper that suppresses tracing only around the curl
call itself, restoring it via a RETURN trap, and use it at all four
call sites instead of duplicating the -H flag.

Signed-off-by: Marco Nenciarini <[email protected]>
@mnencia
mnencia force-pushed the dev/backup-plugin-test branch from 39e702c to 3e4bf4d Compare July 6, 2026 20:49
@mnencia

mnencia commented Jul 6, 2026

Copy link
Copy Markdown
Member

/test

@github-actions

github-actions Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

The segment holding a plugin backup's stop record can stay unarchived
until archive_timeout closes it on its own; this test's restore
happens well within that window, so it needs the explicit switch.
Written to stand on its own rather than by contrast with the in-core
tests, since those are expected to go away once in-core Barman Cloud
support is dropped.

Signed-off-by: Marco Nenciarini <[email protected]>
@mnencia
mnencia force-pushed the dev/backup-plugin-test branch from 3e4bf4d to 9a962ff Compare July 7, 2026 12:05
@mnencia mnencia added backport-requested ◀️ This pull request should be backported to all supported releases release-1.28 release-1.29 release-1.30 and removed do not backport This PR must not be backported - it will be in the next minor release labels Jul 7, 2026
@mnencia
mnencia merged commit 08ead64 into main Jul 7, 2026
46 of 47 checks passed
@mnencia
mnencia deleted the dev/backup-plugin-test branch July 7, 2026 13:03
cnpg-bot pushed a commit that referenced this pull request Jul 7, 2026
In-core Barman Cloud support is deprecated in favour of the Barman Cloud
plugin, so the e2e suite needs to cover backups taken through the
plugin. The plugin follows its own release cycle, so the build to test
is chosen at invocation time: the latest release, the current main, or a
pinned version when reproducing an issue.

On kind and k3d, once the operator is up, the suite installs
cert-manager (a plugin prerequisite) and the Barman Cloud plugin into
cnpg-system, defaulting to the latest plugin release; the resolved
operator and plugin versions are printed at the start of the run.

The suite then covers, through the plugin:

- a smoke round-trip: a cluster archives through the plugin, the
operator reports it as loaded, and a backup is taken, restored into a
new cluster via the externalClusters plugin source, and verified
- a replica cluster bootstrapped from a plugin backup, then streaming
from the source
- tablespaces surviving a backup and restore round-trip
- a plugin-backed cluster across an in-place operator upgrade, with a
backup taken through the plugin afterwards
- a ScheduledBackup with the immediate option, a prefer-standby backup
target verified to run on a replica, and a point-in-time recovery from
an external cluster definition

The in-core variants stay until the in-core support is removed; their
clusters are shared with volume-snapshot scenarios that have no plugin
counterpart yet. The new specs use a dedicated plugin-barman-cloud
label: "plugin" already selects the kubectl-cnpg tests, whose
certificate spec restarts the operator and would fail anything running
alongside it.

cert-manager is now installed on every kind/k3d e2e run; its version is
Renovate-tracked. The operator under test stays the local build by
default.

To pick the plugin build a run validates, pass barman_plugin (alias bp)
to the /test command on a pull request — /test barman_plugin=release
(the default), /test bp=main, or /test bp=v0.12.0 for a pinned version —
or set the barman_plugin workflow_dispatch input to the same value.
Locally, the equivalent is BARMAN_PLUGIN_VERSION=main
./hack/e2e/run-e2e-local.sh.

Signed-off-by: Armando Ruocco <[email protected]>
Signed-off-by: Niccolò Fei <[email protected]>
Signed-off-by: Marco Nenciarini <[email protected]>
Co-authored-by: Niccolò Fei <[email protected]>
Co-authored-by: Marco Nenciarini <[email protected]>
(cherry picked from commit 08ead64)
cnpg-bot pushed a commit that referenced this pull request Jul 7, 2026
In-core Barman Cloud support is deprecated in favour of the Barman Cloud
plugin, so the e2e suite needs to cover backups taken through the
plugin. The plugin follows its own release cycle, so the build to test
is chosen at invocation time: the latest release, the current main, or a
pinned version when reproducing an issue.

On kind and k3d, once the operator is up, the suite installs
cert-manager (a plugin prerequisite) and the Barman Cloud plugin into
cnpg-system, defaulting to the latest plugin release; the resolved
operator and plugin versions are printed at the start of the run.

The suite then covers, through the plugin:

- a smoke round-trip: a cluster archives through the plugin, the
operator reports it as loaded, and a backup is taken, restored into a
new cluster via the externalClusters plugin source, and verified
- a replica cluster bootstrapped from a plugin backup, then streaming
from the source
- tablespaces surviving a backup and restore round-trip
- a plugin-backed cluster across an in-place operator upgrade, with a
backup taken through the plugin afterwards
- a ScheduledBackup with the immediate option, a prefer-standby backup
target verified to run on a replica, and a point-in-time recovery from
an external cluster definition

The in-core variants stay until the in-core support is removed; their
clusters are shared with volume-snapshot scenarios that have no plugin
counterpart yet. The new specs use a dedicated plugin-barman-cloud
label: "plugin" already selects the kubectl-cnpg tests, whose
certificate spec restarts the operator and would fail anything running
alongside it.

cert-manager is now installed on every kind/k3d e2e run; its version is
Renovate-tracked. The operator under test stays the local build by
default.

To pick the plugin build a run validates, pass barman_plugin (alias bp)
to the /test command on a pull request — /test barman_plugin=release
(the default), /test bp=main, or /test bp=v0.12.0 for a pinned version —
or set the barman_plugin workflow_dispatch input to the same value.
Locally, the equivalent is BARMAN_PLUGIN_VERSION=main
./hack/e2e/run-e2e-local.sh.

Signed-off-by: Armando Ruocco <[email protected]>
Signed-off-by: Niccolò Fei <[email protected]>
Signed-off-by: Marco Nenciarini <[email protected]>
Co-authored-by: Niccolò Fei <[email protected]>
Co-authored-by: Marco Nenciarini <[email protected]>
(cherry picked from commit 08ead64)
cnpg-bot pushed a commit that referenced this pull request Jul 7, 2026
In-core Barman Cloud support is deprecated in favour of the Barman Cloud
plugin, so the e2e suite needs to cover backups taken through the
plugin. The plugin follows its own release cycle, so the build to test
is chosen at invocation time: the latest release, the current main, or a
pinned version when reproducing an issue.

On kind and k3d, once the operator is up, the suite installs
cert-manager (a plugin prerequisite) and the Barman Cloud plugin into
cnpg-system, defaulting to the latest plugin release; the resolved
operator and plugin versions are printed at the start of the run.

The suite then covers, through the plugin:

- a smoke round-trip: a cluster archives through the plugin, the
operator reports it as loaded, and a backup is taken, restored into a
new cluster via the externalClusters plugin source, and verified
- a replica cluster bootstrapped from a plugin backup, then streaming
from the source
- tablespaces surviving a backup and restore round-trip
- a plugin-backed cluster across an in-place operator upgrade, with a
backup taken through the plugin afterwards
- a ScheduledBackup with the immediate option, a prefer-standby backup
target verified to run on a replica, and a point-in-time recovery from
an external cluster definition

The in-core variants stay until the in-core support is removed; their
clusters are shared with volume-snapshot scenarios that have no plugin
counterpart yet. The new specs use a dedicated plugin-barman-cloud
label: "plugin" already selects the kubectl-cnpg tests, whose
certificate spec restarts the operator and would fail anything running
alongside it.

cert-manager is now installed on every kind/k3d e2e run; its version is
Renovate-tracked. The operator under test stays the local build by
default.

To pick the plugin build a run validates, pass barman_plugin (alias bp)
to the /test command on a pull request — /test barman_plugin=release
(the default), /test bp=main, or /test bp=v0.12.0 for a pinned version —
or set the barman_plugin workflow_dispatch input to the same value.
Locally, the equivalent is BARMAN_PLUGIN_VERSION=main
./hack/e2e/run-e2e-local.sh.

Signed-off-by: Armando Ruocco <[email protected]>
Signed-off-by: Niccolò Fei <[email protected]>
Signed-off-by: Marco Nenciarini <[email protected]>
Co-authored-by: Niccolò Fei <[email protected]>
Co-authored-by: Marco Nenciarini <[email protected]>
(cherry picked from commit 08ead64)
NiccoloFei pushed a commit that referenced this pull request Jul 24, 2026
…grade test

PR #10850 worked around the operator setting a cnpg.io/cleanupPlugin
finalizer on the plugin barman-cloud Service, which would otherwise
wedge cnpg-system in Terminating state on namespace deletion. The
plugin upgrade e2e spec deleted the plugin Service ahead of time to
let the operator clear it first.

PR #10940 removed that finalizer from new Services entirely, but the
spec always upgrades between operator builds generated from the
current source tree, so it already carries the fix and the workaround
is stale there.

reset_operator_namespace in hack/testing-tools keeps the same
pre-deletion step, since deploy_operator_from_manifest can target an
arbitrary released operator version, and every version released so
far still sets the old finalizer.

Signed-off-by: Marco Nenciarini <[email protected]>
mnencia added a commit that referenced this pull request Jul 24, 2026
…grade test (#11237)

PR #10850 worked around the operator setting a cnpg.io/cleanupPlugin
finalizer on the plugin barman-cloud Service, which would otherwise
wedge cnpg-system in Terminating state on namespace deletion. The plugin
upgrade e2e spec deleted the plugin Service ahead of time to let the
operator clear it first.

PR #10940 removed that finalizer from new Services entirely, but the
spec always upgrades between operator builds generated from the current
source tree, so it already carries the fix and the workaround is stale
there.

reset_operator_namespace in hack/testing-tools keeps the same
pre-deletion step, since deploy_operator_from_manifest can target an
arbitrary released operator version, and every version released so far
still sets the old finalizer.

Signed-off-by: Marco Nenciarini <[email protected]>
cnpg-bot pushed a commit that referenced this pull request Jul 24, 2026
…grade test (#11237)

PR #10850 worked around the operator setting a cnpg.io/cleanupPlugin
finalizer on the plugin barman-cloud Service, which would otherwise
wedge cnpg-system in Terminating state on namespace deletion. The plugin
upgrade e2e spec deleted the plugin Service ahead of time to let the
operator clear it first.

PR #10940 removed that finalizer from new Services entirely, but the
spec always upgrades between operator builds generated from the current
source tree, so it already carries the fix and the workaround is stale
there.

reset_operator_namespace in hack/testing-tools keeps the same
pre-deletion step, since deploy_operator_from_manifest can target an
arbitrary released operator version, and every version released so far
still sets the old finalizer.

Signed-off-by: Marco Nenciarini <[email protected]>
(cherry picked from commit aae5635)
cnpg-bot pushed a commit that referenced this pull request Jul 24, 2026
…grade test (#11237)

PR #10850 worked around the operator setting a cnpg.io/cleanupPlugin
finalizer on the plugin barman-cloud Service, which would otherwise
wedge cnpg-system in Terminating state on namespace deletion. The plugin
upgrade e2e spec deleted the plugin Service ahead of time to let the
operator clear it first.

PR #10940 removed that finalizer from new Services entirely, but the
spec always upgrades between operator builds generated from the current
source tree, so it already carries the fix and the workaround is stale
there.

reset_operator_namespace in hack/testing-tools keeps the same
pre-deletion step, since deploy_operator_from_manifest can target an
arbitrary released operator version, and every version released so far
still sets the old finalizer.

Signed-off-by: Marco Nenciarini <[email protected]>
(cherry picked from commit aae5635)
cnpg-bot pushed a commit that referenced this pull request Jul 24, 2026
…grade test (#11237)

PR #10850 worked around the operator setting a cnpg.io/cleanupPlugin
finalizer on the plugin barman-cloud Service, which would otherwise
wedge cnpg-system in Terminating state on namespace deletion. The plugin
upgrade e2e spec deleted the plugin Service ahead of time to let the
operator clear it first.

PR #10940 removed that finalizer from new Services entirely, but the
spec always upgrades between operator builds generated from the current
source tree, so it already carries the fix and the workaround is stale
there.

reset_operator_namespace in hack/testing-tools keeps the same
pre-deletion step, since deploy_operator_from_manifest can target an
arbitrary released operator version, and every version released so far
still sets the old finalizer.

Signed-off-by: Marco Nenciarini <[email protected]>
(cherry picked from commit aae5635)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-requested ◀️ This pull request should be backported to all supported releases E2E tests E2E tests tickets for easy triage on release process lgtm This PR has been approved by a maintainer no-issue ok to merge 👌 This PR can be merged release-1.28 release-1.30 size:L This PR changes 100-499 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants