fix: preserve backup_dir on finalizer path for clean_backup_on_delete - #363
Conversation
Same regression as automationcontroller-operator: postgres_skip_data moved backup_dir/timestamp setup into init.yml, which finalizer.yml also runs on CR deletion. set_fact overwrote the block-scoped backup_dir from CR status, so the wrong (empty) directory got deleted instead of the real backup. Guard the three init.yml tasks with `when: not finalizer_run | bool`, consistent with main.yml's existing finalizer_run branching. Assisted by: Claude Signed-off-by: James Marshall <jamarsha@redhat.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughChangesBackup initialization
Estimated code review effort: 1 (Trivial) | ~5 minutes Merge Risk: ⚪ Minimal · up to The change preserves the backup directory during finalizer cleanup, preventing deletion of a newly created empty directory instead of the real backup. No actionable merge-blocking risk remains after normal checks and review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Docstring CoverageExplanation No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 0 files. (1 skipped: 1 unsupported.) ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Nitpick: maybe moved these 3 tasks in an own |
rooftopcellist
left a comment
There was a problem hiding this comment.
Same regression and same fix as ansible/awx-operator#2135 — verified the call graph here matches (finalizer.yml sets a block-scoped backup_dir from CR status, init.yml's unconditional set_fact was overwriting it). Guard looks correct. LGTM.



The postgres_skip_data refactor (#353) moved backup_dir/timestamp
setup into init.yml, which finalizer.yml also runs on CR deletion.
set_fact overwrote the block-scoped backup_dir passed in from CR
status, so delete_backup.yml deleted a freshly created empty
directory instead of the real backup, silently breaking
clean_backup_on_delete.
Guards the three affected tasks with
when: not finalizer_run | bool,matching the existing finalizer_run branching in main.yml.
Summary by CodeRabbit