-
Notifications
You must be signed in to change notification settings - Fork 264
Adding Robust destroy in cluster toolkit #4866
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
Adding Robust destroy in cluster toolkit #4866
Conversation
|
/gemini review |
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.
Code Review
This pull request introduces a --robust flag to the gcluster destroy command, adding functionality for targeted firewall cleanup and an automatic retry mechanism. The changes are well-structured, primarily within cmd/destroy.go. My review focuses on enhancing the robustness of the new error handling and resource cleanup logic to ensure the retry mechanism behaves as expected under failure conditions.
9758ff6 to
df4c3fc
Compare
9f175f3 to
7450b9a
Compare
|
Can we make this the default behaviour for |
I would prefer that we don't change the default yet. Let's test this extensively internally. Most external customers don't need this feature. |
cboneti
left a comment
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.
Good new feature. Thanks!!
6791739
into
GoogleCloudPlatform:develop
Summary of Changes
The
gcluster destroycommand has been enhanced with a--robustflag to improve the reliability of resource cleanup, particularly for firewall rules.The
--robustflag introduces these key features:source: "modules/network/vpc"). The cleanup for a group happens just before that specific group's resources are destroyed. This ensures firewalls are removed at the most appropriate time to avoid "resource in use" errors. The cleanup now uses the Google Cloud Go SDK instead of externalgcloudcalls.User Interaction
--robustis used and firewall rules are found for a group, the user is prompted to confirm their deletion [y/n], unless--auto-approveis also specified.--auto-approveflag suppresses all prompts, including firewall deletion confirmations, for automated workflows.How to Use
Standard Robust Destroy (Interactive)
This will prompt you for confirmation before deleting firewall rules.
Fully Automated Robust Destroy
This will automatically approve and delete all resources, including firewall rules, without any user prompts.
Standard Destroy
The original destroy functionality remains unchanged. The robust logic is only triggered when the
--robustflag is present.How to Test
Deploy a Cluster: First, create a sample deployment if you don't have one already.
Build the Tool: Ensure you have the latest version of the
gclusterbinary with these changes.Run Robust Destroy: Execute the destroy command with the
--robustflag on your deployment directory.Verify the Prompt: The tool should list the firewall rules it intends to delete and wait for your input.
yto confirm and watch the process continue.nto verify that the firewall cleanup is skipped.Verify Automated Destroy: (Optional) If you want to test the non-interactive mode, re-deploy the cluster and run:
The command should complete the entire destruction process without any prompts
Submission Checklist
NOTE: Community submissions can take up to 2 weeks to be reviewed.
Please take the following actions before submitting this pull request.