Skip to content

Fix: Fix Project deletion for non-ARM managed projects#513

Open
tejhan wants to merge 1 commit intoAzure:mainfrom
tejhan:fix/addManagedByArmDistinction
Open

Fix: Fix Project deletion for non-ARM managed projects#513
tejhan wants to merge 1 commit intoAzure:mainfrom
tejhan:fix/addManagedByArmDistinction

Conversation

@tejhan
Copy link
Copy Markdown
Collaborator

@tejhan tejhan commented Mar 24, 2026

Description

The AKSProjectDeleteButton previously would render for any project with the managed-by: aks-desktop label. This worked when the aks-desktop namespaces were exclusively managed, but with both regular & managed namespaces sharing the managed-by:aks-desktop label now (vs. regular namespace previously having managed-by:headlamp), the distinction isn't recognized, leading to the managed namespace delete button rendering for both scenarios. This propagates into an error when trying to delete a normal namespace.

This PR introduces isArmManagedProject which checks for the kubernetes.azure.com/managedByArm: true to identify & use conditionally for registering the correct delete button. This distinction could be used in the future as well for any managed namespace specific operations/logic attached the project.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Performance improvement
  • Code refactoring
  • CI/CD changes
  • Other: **___**

Related Issues

Closes #[issue number]
Related to #[issue number]

Changes Made

  • Added isArmManagedproject to distinguish between regular ASKD projects & managed ones.

Testing

  • Unit tests pass
  • Integration tests pass
  • Manual testing completed
  • Performance tested (if applicable)
  • Accessibility tested (if applicable)

Test Cases

  1. Create a non-managed project.
  2. Click the delete button
  3. You should observe the proper delete button dialogue appear (non- managed deletion)

Note: This was a regression from previous changes, so the deletion logic itself is sound & the same, it just has to scoped differently now.

This also overlaps with some changes in #511, since the managed by ARM distinction is used there as well for conditional access tab registration.

Copilot AI review requested due to automatic review settings March 24, 2026 13:51
Copy link
Copy Markdown
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

This PR fixes a regression where the custom AKSProjectDeleteButton was being shown for non-ARM-managed AKS Desktop projects, causing errors when deleting normal namespaces, by distinguishing ARM-managed namespaces via the kubernetes.azure.com/managedByArm label.

Changes:

  • Added isArmManagedProject utility to detect ARM-managed namespaces (managedByArm: "true").
  • Updated plugin registration so the custom project delete button only enables for ARM-managed projects.
  • Adjusted isAksProject doc/comment to reflect current semantics.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
plugins/aks-desktop/src/utils/shared/isAksProject.ts Adds isArmManagedProject predicate for ARM-managed namespace detection.
plugins/aks-desktop/src/index.tsx Switches delete button enablement from isAksProject to isArmManagedProject.

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

@tejhan tejhan force-pushed the fix/addManagedByArmDistinction branch from e13f5c9 to b758a13 Compare March 25, 2026 18:48
Copy link
Copy Markdown
Collaborator

@vyncent-t vyncent-t left a comment

Choose a reason for hiding this comment

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

Looking solid! this may need a rebase to pass CI checks

Copilot AI review requested due to automatic review settings March 26, 2026 18:40
@tejhan tejhan force-pushed the fix/addManagedByArmDistinction branch from b758a13 to 28ed1e8 Compare March 26, 2026 18:40
Copy link
Copy Markdown
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

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.


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

@tejhan tejhan force-pushed the fix/addManagedByArmDistinction branch from 28ed1e8 to 8e9447e Compare March 26, 2026 19:05
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.

3 participants