-
Notifications
You must be signed in to change notification settings - Fork 68
Fix Stack deletion being blocked by missing prerequisites #1034
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR fixes an issue where Stack deletion would be blocked if prerequisite Stacks were missing or already deleted. The fix allows Stacks with destroyOnFinalize=true to proceed with deletion regardless of prerequisite status, which is essential for GitOps workflows where resources may be deleted in any order.
Key Changes:
- Skip prerequisite validation checks when a Stack is marked for deletion
- Add test coverage for deletion with missing prerequisites
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| operator/internal/controller/pulumi/stack_controller.go | Added logic to skip prerequisite checks during Stack deletion |
| operator/internal/controller/pulumi/stack_controller_test.go | Added test case verifying deletion proceeds despite missing prerequisites |
| CHANGELOG.md | Added entry documenting the fix |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
Verification CompleteI've verified that the fix works correctly by commenting out the Test ResultsWithout the fix (continue block commented out):
With the fix (continue block active):
This demonstrates that the fix correctly allows Stack deletion to proceed even when prerequisites are missing, which is essential for GitOps workflows where resources may be deleted in any order. |
Fixes #751 When a Stack with destroyOnFinalize=true is being deleted, skip prerequisite validation to allow deletion to proceed even if prerequisite Stacks are missing or have already been deleted. This is important for GitOps workflows with tools like Flux and ArgoCD where resources may be deleted in any order. Prerequisites are only relevant during creation/updates for dependency ordering and output references. During deletion, these dependencies are not relevant (except if --run-program were used, but a missing prerequisite would block deletion forever). The implementation uses an early continue in the prerequisite loop, allowing for future enhancements where individual prerequisites could be configured as deletion blockers. Changes: - Skip prerequisite checks during Stack deletion - Add test case for deletion with missing prerequisites - Update CHANGELOG 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <[email protected]>
3b3eff0 to
5bb6abf
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1034 +/- ##
==========================================
+ Coverage 53.03% 53.32% +0.29%
==========================================
Files 34 34
Lines 4646 5016 +370
==========================================
+ Hits 2464 2675 +211
- Misses 1987 2134 +147
- Partials 195 207 +12 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Fixes #751
Summary
When a Stack with
destroyOnFinalize=trueis being deleted, skip prerequisite validation to allow deletion to proceed even if prerequisite Stacks are missing or have already been deleted.This is important for GitOps workflows with tools like Flux and ArgoCD where resources may be deleted in any order.
Changes
Rationale
Prerequisites are only relevant during creation/updates for dependency ordering and output references. During deletion, these dependencies are not relevant (except if
--run-programwere used, but a missing prerequisite would block deletion forever).The implementation uses an early
continuein the prerequisite loop, allowing for future enhancements where individual prerequisites could be configured as deletion blockers.Test Plan
🤖 Generated with Claude Code