plugin-barman-cloud/internal
Marco Nenciarini 11469e3ef3 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-24 09:37:34 +02:00
..
cmd fix(restore): use custom CNPG group and version for scheme registration (#847) 2026-04-13 13:20:38 +02:00
cnpgi fix: stop keeping the sidecar forever on recovery-only clusters 2026-08-24 09:37:34 +02:00
controller fix(deps): update module sigs.k8s.io/controller-runtime to v0.24.0 (#880) 2026-05-06 10:15:29 +02:00
scheme fix(scheme): register meta types for CNPG scheme group version (#943) 2026-06-08 11:08:15 +02:00