-
Notifications
You must be signed in to change notification settings - Fork 1.7k
fix(helm): implement ordered cleanup for Helm releases based on dependency levels #9838
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
base: main
Are you sure you want to change the base?
fix(helm): implement ordered cleanup for Helm releases based on dependency levels #9838
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.
Summary of Changes
Hello @BabisK, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!
This pull request addresses a critical issue in Helm release cleanup by introducing a dependency-aware uninstallation process. Previously, releases were cleaned up in an arbitrary order, which could lead to errors if a dependent release was removed before its dependencies. The changes ensure that Helm releases are now uninstalled in the reverse order of their deployment, respecting defined dependencies, thereby providing a more robust and reliable cleanup mechanism.
Highlights
- Helm Cleanup Logic: The core Helm cleanup function (
Cleanup
) has been refactored to first construct a dependency graph of all configured Helm releases. - Ordered Uninstallation: Releases are now uninstalled level by level, starting from the highest dependency level (most dependent releases) down to the lowest (least dependent releases). Within each level, releases are also uninstalled in reverse order of their definition, ensuring that dependencies are respected during teardown.
- Go
slices
Package Adoption: The newslices
package (Go 1.21+) is utilized to facilitate backward iteration over release levels and releases within each level, ensuring the correct cleanup order. - Improved Testing: A new comprehensive test case has been added to
helm_test.go
to explicitly validate the new ordered cleanup behavior, ensuring that releases are deleted in the correct sequence based on their dependencies.
Using Gemini Code Assist
The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.
Invoking Gemini
You can request assistance from Gemini at any point in your pull request via creating an issue comment (i.e. comment on the pull request page) using either /gemini <command>
or @gemini-code-assist <command>
. Below is a summary of the supported commands.
Feature | Command | Description |
---|---|---|
Code Review | /gemini review |
Performs a code review for the current pull request in its current state. |
Pull Request Summary | /gemini summary |
Provides a summary of the current pull request in its current state. |
Comment | @gemini-code-assist | Responds in comments when explicitly tagged, both in issue comments and review comments. |
Help | /gemini help |
Displays a list of available commands. |
Customization
To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/
folder in the base of the repository. Detailed instructions can be found here.
Limitations & Feedback
Gemini Code Assist is currently in preview and may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments to provide feedback.
You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.
Footnotes
-
Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩
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 an important fix for Helm release cleanup, ensuring that dependencies are respected by deleting releases in the reverse order of their deployment. The implementation correctly uses a dependency graph to determine the cleanup order, handling different dependency levels and the order of releases within each level. I've added comments to improve error handling and logging.
Fixes: #9837
Related: #7284
Merge before/after: Dependent or prerequisite PRs
Description
Respect the dependency graph between helm releases during clean up. Levels of the graph are cleaned on reverse order compared to installation. Releases in the same level are cleaned up in reverse order too.
User facing changes (remove if N/A)
Before
Releases are undeployed in the order they are mentioned in Config.
After
Releases are undeployed in the reverse order they were deployed, respecting the
dependsOn
values.