Skip to content

fix(bundler): clean up kai-resource-reservation namespace on undeploy#394

Merged
mchmarny merged 1 commit intoNVIDIA:mainfrom
yuanchen8911:fix/undeploy-kai-reservation-ns
Mar 13, 2026
Merged

fix(bundler): clean up kai-resource-reservation namespace on undeploy#394
mchmarny merged 1 commit intoNVIDIA:mainfrom
yuanchen8911:fix/undeploy-kai-reservation-ns

Conversation

@yuanchen8911
Copy link
Copy Markdown
Contributor

Summary

  • Add explicit cleanup of the kai-resource-reservation namespace during undeploy, which is created at runtime by the kai-scheduler but is not tracked in the bundle's namespace list.

Motivation / Context

The kai-scheduler creates a kai-resource-reservation namespace at runtime for resource reservations. Since this namespace is not part of the bundle's declared namespace list, undeploy.sh never deleted it, leaving it behind on the cluster.

Fixes: #390
Related: N/A

Type of Change

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Documentation update
  • Refactoring (no functional changes)
  • Build/CI/tooling

Component(s) Affected

  • CLI (cmd/aicr, pkg/cli)
  • API server (cmd/aicrd, pkg/api, pkg/server)
  • Recipe engine / data (pkg/recipe)
  • Bundlers (pkg/bundler, pkg/component/*)
  • Collectors / snapshotter (pkg/collector, pkg/snapshotter)
  • Validator (pkg/validator)
  • Core libraries (pkg/errors, pkg/k8s)
  • Docs/examples (docs/, examples/)
  • Other: ____________

Implementation Notes

The delete_namespace helper already handles --keep-namespaces, protected namespace checks, and missing namespaces gracefully — so this is a safe, no-op addition when the namespace does not exist.

Testing

go build ./pkg/bundler/...

Build passes. The template change is a shell script addition that uses the existing delete_namespace function.

Risk Assessment

  • Low — Isolated change, well-tested, easy to revert

Rollout notes: N/A — takes effect on next bundle generation.

Checklist

  • Tests pass locally (make test with -race)
  • Linter passes (make lint)
  • I did not skip/disable tests to make CI green
  • I added/updated tests for new functionality
  • I updated docs if user-facing behavior changed
  • Changes follow existing patterns in the codebase
  • Commits are cryptographically signed (git commit -S) — GPG signing info

The kai-scheduler creates a kai-resource-reservation namespace at
runtime for resource reservations. This namespace is not in the
bundle's namespace list and was left behind after undeploy.

Fixes: NVIDIA#390

Signed-off-by: Yuan Chen <yuanchen97@gmail.com>
@mchmarny mchmarny merged commit 7d79830 into NVIDIA:main Mar 13, 2026
14 checks passed
xdu31 pushed a commit to xdu31/aicr that referenced this pull request Mar 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/bundler bug Something isn't working size/XS

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(bundler): undeploy.sh should clean up kai-resource-reservation namespace

2 participants