Fix: Fix Project deletion for non-ARM managed projects#513
Fix: Fix Project deletion for non-ARM managed projects#513tejhan wants to merge 1 commit intoAzure:mainfrom
Conversation
There was a problem hiding this comment.
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
isArmManagedProjectutility to detect ARM-managed namespaces (managedByArm: "true"). - Updated plugin registration so the custom project delete button only enables for ARM-managed projects.
- Adjusted
isAksProjectdoc/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.
e13f5c9 to
b758a13
Compare
vyncent-t
left a comment
There was a problem hiding this comment.
Looking solid! this may need a rebase to pass CI checks
b758a13 to
28ed1e8
Compare
There was a problem hiding this comment.
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.
28ed1e8 to
8e9447e
Compare
Description
The
AKSProjectDeleteButtonpreviously 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 havingmanaged-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
isArmManagedProjectwhich checks for thekubernetes.azure.com/managedByArm: trueto 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
Related Issues
Closes #[issue number]
Related to #[issue number]
Changes Made
isArmManagedprojectto distinguish between regular ASKD projects & managed ones.Testing
Test Cases
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.