feat: add undeploy.sh script to Helm bundle deployer#91
Merged
Conversation
Generate an undeploy.sh alongside deploy.sh that uninstalls components in reverse deployment order with namespace cleanup support.
There was a problem hiding this comment.
Pull request overview
This PR adds automated undeployment capability to the Helm bundle deployer by generating an undeploy.sh script alongside the existing deploy.sh script. The undeploy script reverses the deployment order (uninstalling components from last to first), removes manifests before helm releases, and provides a --keep-namespaces flag to optionally preserve namespaces.
Changes:
- Added
undeploy.sh.tmpltemplate that generates a bash script for automated component uninstallation - Updated Helm deployer to generate the undeploy script with proper permissions (0755)
- Enhanced test coverage to verify undeploy script generation, permissions, and reverse ordering
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| pkg/bundler/deployer/helm/templates/undeploy.sh.tmpl | New template for generating the automated undeployment script with reverse-order component removal and namespace cleanup |
| pkg/bundler/deployer/helm/helm.go | Added generateUndeployScript function and integrated it into the bundle generation workflow |
| pkg/bundler/deployer/helm/helm_test.go | Added comprehensive test coverage for undeploy script generation, permissions, and reverse-order verification |
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.
Summary
undeploy.shscript generation alongsidedeploy.shin the Helm bundle deployer--keep-namespacesflag to skip namespace deletionTest plan
TestGenerate_UndeployScriptExecutable— verifies permissions, shebang, strict mode,helm uninstall, reverse orderTestGenerate_Success— updated to checkundeploy.shin root filesTestGenerate_WithChecksums— updated to verifyundeploy.shin checksumsmake testpasses with race detectormake lintpasses clean