Skip to content

feat: add undeploy.sh script to Helm bundle deployer#91

Merged
mchmarny merged 5 commits intomainfrom
feature/undeploy
Feb 11, 2026
Merged

feat: add undeploy.sh script to Helm bundle deployer#91
mchmarny merged 5 commits intomainfrom
feature/undeploy

Conversation

@mchmarny
Copy link
Member

Summary

  • Add undeploy.sh script generation alongside deploy.sh in the Helm bundle deployer
  • Uninstalls components in reverse deployment order (manifests first, then helm release, then namespace)
  • Supports --keep-namespaces flag to skip namespace deletion

Test plan

  • TestGenerate_UndeployScriptExecutable — verifies permissions, shebang, strict mode, helm uninstall, reverse order
  • TestGenerate_Success — updated to check undeploy.sh in root files
  • TestGenerate_WithChecksums — updated to verify undeploy.sh in checksums
  • make test passes with race detector
  • make lint passes clean

Generate an undeploy.sh alongside deploy.sh that uninstalls components
in reverse deployment order with namespace cleanup support.
Copilot AI review requested due to automatic review settings February 10, 2026 23:22
@mchmarny mchmarny requested a review from a team as a code owner February 10, 2026 23:22
@mchmarny mchmarny requested a review from coffeepac February 10, 2026 23:23
@mchmarny mchmarny added the bug Something isn't working label Feb 10, 2026
@mchmarny mchmarny self-assigned this Feb 10, 2026
Copy link

Copilot AI left a 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 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.tmpl template 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

Copy link
Contributor

@yuanchen8911 yuanchen8911 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@mchmarny mchmarny merged commit 73accda into main Feb 11, 2026
5 checks passed
@mchmarny mchmarny deleted the feature/undeploy branch February 11, 2026 00:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants