Skip to content

Conversation

@codyrancher
Copy link
Member

@codyrancher codyrancher commented Jan 7, 2026

Summary

Fixes #11128

Added the ability to remove namespaces from projects entirely, not just move them between projects. Previously, the "Move" action on namespaces only allowed moving to another project. Now users can select "None (remove from project)" to disassociate a namespace from any project.

Occurred changes and/or fixed issues

  • Added "None (remove from project)" option to the target project dropdown in the Move Namespace dialog
  • When "None" is selected, the field.cattle.io/projectId label and annotation are cleared from the namespace
  • Added unit tests for the new functionality

Areas or cases that should be tested

  1. Select a namespace that is currently in a project, click "Move", verify "None (remove from project)" appears as the first option and is selected by default
  2. Click "Move" with "None" selected - verify namespace is removed from the project (no longer appears under that project in the UI)
  3. Select a different project from the dropdown and click "Move" - verify namespace moves to the new project (existing functionality still works)
  4. Test bulk selection: select multiple namespaces from the same project, click "Move", select "None", verify all are removed from the project

Areas which could experience regressions

  • Moving namespaces between projects (existing functionality)
  • Bulk move operations for namespaces
  • Namespace list filtering by project (namespaces removed from projects should appear in "Not in a Project" group)
  • Project resource counts (should decrease when namespace is removed)

Screenshot/Video

Checklist

  • The PR is linked to an issue and the linked issue has a Milestone, or no issue is needed
  • The PR has a Milestone
  • The PR template has been filled out
  • The PR has been self reviewed
  • The PR has a reviewer assigned
  • The PR has automated tests or clear instructions for manual tests and the linked issue has appropriate QA labels, or tests are not needed
  • The PR has reviewed with UX and tested in light and dark mode, or there are no UX changes
  • The PR has been reviewed in terms of Accessibility
  • The PR has considered, and if applicable tested with, the three Global Roles Admin, Standard User and User Base

Previously, the Move Namespace dialog only allowed moving namespaces
between projects. This change adds a "None" option that allows users
to completely disassociate a namespace from any project by clearing
the field.cattle.io/projectId label and annotation.

- Add "None (remove from project)" option to project dropdown
- Handle empty targetProject in move() to clear labels/annotations
- Default targetProject to empty string to match "None" option
- Add unit tests for the new functionality

Fixes rancher#11128
@rancher-ui-project-bot rancher-ui-project-bot bot added this to the v2.14.0 milestone Jan 7, 2026
@codyrancher codyrancher changed the title 11128 Added the ability to remove namespaces from projects entirely, not just move them between projects. Jan 8, 2026
@codyrancher codyrancher requested a review from torchiaf January 8, 2026 01:15
@codyrancher codyrancher marked this pull request as ready for review January 8, 2026 01:16
Copy link
Member

@eva-vashkevich eva-vashkevich left a comment

Choose a reason for hiding this comment

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

I think bulk move is broken. It seems to only apply to the first ns being moved.
ie if I have one ns without a project and one in a project, bulk moving them to none doesn't work. I don't think it was caused by this change, but would be good to fix it. Or we can open a new issue.

Screen.Recording.2026-01-08.at.9.30.02.AM.mov
Screen.Recording.2026-01-08.at.9.23.52.AM.mov

Copy link
Member

@eva-vashkevich eva-vashkevich left a comment

Choose a reason for hiding this comment

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

lgtm

@codyrancher codyrancher merged commit 91450a9 into rancher:master Jan 8, 2026
118 of 122 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move out Namespaces from Projects

2 participants