plugin-barman-cloud/internal/cnpgi/operator
Armando Ruocco d05559a07f fix(rbac): reconcile Role when ObjectStore spec changes
When an ObjectStore's credentials change (e.g., secret rename), the
RBAC Role granting the Cluster's ServiceAccount access to those secrets
was not updated because nothing triggered a Cluster reconciliation.

Implement the ObjectStore controller's Reconcile to detect referencing
Clusters and update their Roles directly. Extract ensureRole into a
shared rbac.EnsureRole function used by both the Pre hook and the
ObjectStore controller.

The shared EnsureRole accepts optional beforeCreate callbacks so the
Pre hook can set owner references on Role creation, while the
ObjectStore controller path skips ownership (it only updates existing
Roles).

Handle deleted ObjectStores gracefully by skipping NotFound errors
during Role reconciliation, and filter status-only changes with
GenerationChangedPredicate.

Add RBAC permission for the plugin to list/watch Clusters so the
ObjectStore controller can find affected Clusters. Regenerate
config/rbac/role.yaml.

Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
2026-03-26 16:14:24 +01:00
..
config feat(ip): assign copyright to the Linux Foundation (#571) 2025-10-07 18:06:06 +02:00
rbac fix(rbac): reconcile Role when ObjectStore spec changes 2026-03-26 16:14:24 +01:00
specs feat: add support for DefaultAzureCredential authentication mechanism (#681) 2026-01-08 14:58:27 +01:00
doc.go feat(ip): assign copyright to the Linux Foundation (#571) 2025-10-07 18:06:06 +02:00
identity.go feat(ip): assign copyright to the Linux Foundation (#571) 2025-10-07 18:06:06 +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 feat(ip): assign copyright to the Linux Foundation (#571) 2025-10-07 18:06:06 +02:00
lifecycle_test.go feat(ip): assign copyright to the Linux Foundation (#571) 2025-10-07 18:06:06 +02:00
lifecycle.go chore(deps): update golangci/golangci-lint docker tag to v2.8.0 (#721) 2026-01-14 12:20:09 +01:00
manager.go fix: set LeaderElectionReleaseOnCancel to true to enable RollingUpdates (#615) 2025-10-24 14:00:24 +02:00
ownership.go feat(ip): assign copyright to the Linux Foundation (#571) 2025-10-07 18:06:06 +02:00
reconciler.go fix(rbac): reconcile Role when ObjectStore spec changes 2026-03-26 16:14:24 +01: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