fix: honour the object store requested by a Backup resource - #1076
Open
ildar-fix wants to merge 2 commits into
Open
fix: honour the object store requested by a Backup resource#1076ildar-fix wants to merge 2 commits into
ildar-fix wants to merge 2 commits into
Conversation
added 2 commits
August 26, 2026 10:32
The operator relays the parameters of a Backup resource to the plugin in the BackupRequest, but the plugin builds its configuration from the Cluster alone. A Backup asking for a different object store is therefore written to the cluster one, and it completes without any warning, so the mistake surfaces only when the archive turns out to be empty. Apply the parameters of the Backup on top of the configuration derived from the Cluster, so that barmanObjectName and serverName select the destination of that single backup. Closes cloudnative-pg#611 Assisted-by: Claude Opus 5 Signed-off-by: Ildar Gilyazev <horiganmikle@gmail.com>
The Role bound to the instance service account is built from the object stores the Cluster refers to, so a Backup naming any other store fails with a forbidden error on objectstores. The object store selection of a Backup is therefore unusable on its own. Add the additionalBarmanObjectNames parameter, a comma separated list of stores that take part in the RBAC and in the certificates of the instances while nothing is routed to them, so that a Backup can name one of them. Closes cloudnative-pg#611 Assisted-by: Claude Opus 5 Signed-off-by: Ildar Gilyazev <horiganmikle@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #611
Problem
The operator relays the parameters of a
Backupresource to the plugin in theBackupRequest(
pkg/management/postgres/webserver/plugin_backup.go->internal/cnpi/plugin/client/backup.go), butBackupServiceImplementation.Backupbuilds its configuration from theClusteralone and never readsrequest.Parameters. ABackupasking for a different object store is written to the cluster one, and it endsup
completedwith no warning: the only symptom is an archive that stays empty.What this does
First commit applies the parameters of the
Backupon top of the configuration derived from theCluster, sothat
barmanObjectNameandserverNameselect the destination of that single backup. ABackupwithoutparameters behaves exactly as before.
Second commit adds the
additionalBarmanObjectNamescluster level parameter. It is needed to make the first oneusable: the
Rolebound to the instance service account is built from the object stores theClusterrefers to,so a
Backupnaming any other store fails withobjectstores.barmancloud.cnpg.io "..." is forbidden. Theparameter is a comma separated list of stores that take part in the RBAC and in the certificates of the
instances, while nothing is routed to them.