Fix custom backup PVC name not used with create_backup_pvc#2105
Merged
aknochow merged 1 commit intoansible:develfrom Mar 5, 2026
Merged
Fix custom backup PVC name not used with create_backup_pvc#2105aknochow merged 1 commit intoansible:develfrom
aknochow merged 1 commit intoansible:develfrom
Conversation
When backup_pvc is specified with create_backup_pvc: true, the PVC template and ownerReference removal used the hardcoded default name (deployment_name-backup-claim) instead of the user-specified name. This caused the management pod to reference a PVC that didn't exist. Replace backup_claim variable with backup_pvc throughout the backup role so the resolved PVC name is used consistently in all templates. Authored By: Adam Knochowski <aknochow@redhat.com> Assisted By: Claude
1c8306c to
20eda56
Compare
rooftopcellist
approved these changes
Mar 5, 2026
Member
|
@aknochow you need to add the "change type" to the PR description body for CI to pass.
|
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.
ISSUE TYPE
New or Enhanced Feature
Summary
Fix custom backup PVC name not being used when
create_backup_pvc: trueandbackup_pvcis specified.Problem
When a user specifies
backup_pvc: my-custom-pvcwithcreate_backup_pvc: true, the operator creates a PVC named{deployment_name}-backup-claim(the hardcoded default) instead ofmy-custom-pvc. The management pod then tries to mount the custom-named PVC which doesn't exist, causing the backup to hang.The
backup_claimvariable was correctly resolved frombackup_pvc, but the PVC template and ownerReference removal used the hardcoded{{ deployment_name }}-backup-claimname instead.Solution
Replace the
backup_claimvariable withbackup_pvcthroughout the backup role. Theset_factnow resolvesbackup_pvcdirectly (defaulting to{deployment_name}-backup-claimwhen not specified), and all templates reference{{ backup_pvc }}.Changes
roles/backup/tasks/init.yml:set_factresolvesbackup_pvcinstead ofbackup_claim; ownerRef removal uses{{ backup_pvc }}roles/backup/templates/backup_pvc.yml.j2: PVC name uses{{ backup_pvc }}roles/backup/templates/management-pod.yml.j2:claimNameuses{{ backup_pvc }}roles/backup/tasks/update_status.yml:backupClaimuses{{ backup_pvc }}Testing
Tested on MicroShift with custom backup PVC names and sizes per component. All PVCs created with correct custom names and backup completed successfully.