Skip to content

frontend: project: Disable assigned namespaces in project creation#4451

Open
pallava-joshi wants to merge 1 commit intokubernetes-sigs:mainfrom
pallava-joshi:fix/disable-assigned-namespaces-in-project-creation
Open

frontend: project: Disable assigned namespaces in project creation#4451
pallava-joshi wants to merge 1 commit intokubernetes-sigs:mainfrom
pallava-joshi:fix/disable-assigned-namespaces-in-project-creation

Conversation

@pallava-joshi
Copy link
Contributor

Summary

Fixes #4086
Prevents users from accidentally reassigning namespaces that are already part of another project when creating a new project.

Changes

  • Added detection for namespaces that already have a headlamp.dev/project-id label (i.e., are assigned to an existing project)
  • Disabled these namespaces in the namespace dropdown during project creation
  • Users can still type a new namespace name, but cannot select one that's already assigned

Steps to Test

  1. Navigate to the Projects tab on the home page
  2. Create a project (e.g., "project-a") using a namespace (e.g., "default")
  3. Return to the project list and click "Create Project" again
  4. In the namespace dropdown, observe that "default" is now greyed out and cannot be selected
  5. You can still type a new namespace name to create a new project

Screenshots (if applicable)

Screen.Recording.2026-01-25.at.6.41.12.PM.mov

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: pallava-joshi
Once this PR has been reviewed and has the lgtm label, please assign sniok for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jan 25, 2026
@pallava-joshi pallava-joshi force-pushed the fix/disable-assigned-namespaces-in-project-creation branch from 173712d to 7d72c3c Compare January 27, 2026 18:49
@illume illume requested a review from Copilot January 28, 2026 19:00
Copy link
Contributor

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

Prevents users from reassigning namespaces that are already associated with an existing project during “New Project” creation (fixes #4086).

Changes:

  • Detect namespaces that already have the headlamp.dev/project-id label.
  • Disable already-assigned namespaces in the namespace Autocomplete dropdown during project creation.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@illume illume left a comment

Choose a reason for hiding this comment

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

Thanks!

Please consider the following commit message:

frontend: project: Disable assigned namespaces in project creation

Can you please check the open review comments?

@illume illume added frontend Issues related to the frontend kind/bug Categorizes issue or PR as related to a bug. labels Jan 28, 2026
@pallava-joshi pallava-joshi force-pushed the fix/disable-assigned-namespaces-in-project-creation branch from 7d72c3c to 2e3210d Compare January 29, 2026 05:28
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jan 29, 2026
@pallava-joshi pallava-joshi force-pushed the fix/disable-assigned-namespaces-in-project-creation branch from 2e3210d to d5a2134 Compare January 29, 2026 05:31
@pallava-joshi pallava-joshi changed the title frontend: disable assigned namespaces in project creation frontend: project: Disable assigned namespaces in project creation Jan 29, 2026
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 30, 2026
@pallava-joshi pallava-joshi force-pushed the fix/disable-assigned-namespaces-in-project-creation branch from d5a2134 to ba9e57f Compare January 31, 2026 05:06
@k8s-ci-robot k8s-ci-robot added size/S Denotes a PR that changes 10-29 lines, ignoring generated files. and removed needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jan 31, 2026
@pallava-joshi pallava-joshi force-pushed the fix/disable-assigned-namespaces-in-project-creation branch from ba9e57f to 22ea21d Compare January 31, 2026 05:23
@illume illume added this to the v0.41.0 milestone Feb 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. frontend Issues related to the frontend kind/bug Categorizes issue or PR as related to a bug. projects size/S Denotes a PR that changes 10-29 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Projects rename/restart when recreated

3 participants