plugin-barman-cloud/internal/cnpgi/operator
Marco Nenciarini fb3397386c fix: stop keeping the sidecar forever on recovery-only clusters
A cluster bootstrapped only via RecoveryBarmanObjectName, with no
continuing archiving or replica source, only ever needs the sidecar
for its one-time bootstrap restore. Gate its injection on
cluster.Status.CurrentPrimary being unset, so it stops being added
once that instance is up.

CurrentPrimary is set by the instance manager itself, from inside the
primary pod, only once it has completed its own bootstrap - unlike
cluster.Status.Instances / IsInitialized(), which flips as soon as the
instance's PVC exists, well before the pod is even created. Gating on
IsInitialized() would mean the sidecar is never added to the one pod
that needs it to perform its restore.

Once CurrentPrimary is set, this makes the operator's own drift-check
see the already-running pod's spec as outdated and roll it out to drop
the sidecar. That is deliberately accepted rather than engineered
around: it is one deterministic rollout using the same machinery the
operator already uses for every other pod-spec change (a switchover if
a replica is available, an in-place restart otherwise), not a new or
fragile risk.

Signed-off-by: Marco Nenciarini <marco.nenciarini@enterprisedb.com>
2026-08-27 09:27:32 +02:00
..
config refactor: deduplicate barman object store presence check 2026-08-27 09:27:32 +02:00
rbac fix(deps): update module sigs.k8s.io/controller-runtime to v0.24.0 (#880) 2026-05-06 10:15:29 +02:00
specs chore(deps): update golangci/golangci-lint docker tag to v2.12.0 (#881) 2026-05-04 16:01:21 +02:00
doc.go feat(ip): assign copyright to the Linux Foundation (#571) 2025-10-07 18:06:06 +02:00
identity.go fix(metrics): announce sidecar injection capability (#776) 2026-03-31 15:36:09 +02:00
lifecycle_certificates.go feat(ip): assign copyright to the Linux Foundation (#571) 2025-10-07 18:06:06 +02:00
lifecycle_envs.go feat(ip): assign copyright to the Linux Foundation (#571) 2025-10-07 18:06:06 +02:00
lifecycle_resources.go fix: inject barman sidecar in replica clusters bootstrapped with pg_basebackup (#965) 2026-06-19 10:18:36 +02:00
lifecycle_test.go fix: stop keeping the sidecar forever on recovery-only clusters 2026-08-27 09:27:32 +02:00
lifecycle.go fix: stop keeping the sidecar forever on recovery-only clusters 2026-08-27 09:27:32 +02:00
manager.go fix(deps): update module sigs.k8s.io/controller-runtime to v0.24.0 (#880) 2026-05-06 10:15:29 +02:00
reconciler.go feat: configure k8s recommended labels on subresources (#865) 2026-04-29 14:35:43 +02:00
start.go feat(ip): assign copyright to the Linux Foundation (#571) 2025-10-07 18:06:06 +02:00
suite_test.go feat(ip): assign copyright to the Linux Foundation (#571) 2025-10-07 18:06:06 +02:00