Fetch Azure Role Assignments for the Access tab in managed projects#511
Open
tejhan wants to merge 1 commit intoAzure:mainfrom
Open
Fetch Azure Role Assignments for the Access tab in managed projects#511tejhan wants to merge 1 commit intoAzure:mainfrom
tejhan wants to merge 1 commit intoAzure:mainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a custom Access tab experience for ARM-managed AKS Desktop projects, enabling the UI to fetch and display Azure Role Assignments for the project namespace, while leaving non-managed projects on the default Kubernetes access view.
Changes:
- Adds ARM-managed project detection via a new
isArmManagedProjecthelper. - Introduces an Azure CLI utility to list role assignments for a managed namespace.
- Registers a custom Access tab and implements a hook-driven UI to fetch/cache/display assignments.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 10 comments.
Show a summary per file
| File | Description |
|---|---|
| plugins/aks-desktop/src/utils/shared/isAksProject.ts | Adds ARM-managed project detection based on a namespace label. |
| plugins/aks-desktop/src/utils/azure/az-cli.ts | Adds listNamespaceRoleAssignments() and a role-assignment shape for UI consumption. |
| plugins/aks-desktop/src/index.tsx | Registers an Access tab override for ARM-managed projects. |
| plugins/aks-desktop/src/components/AccessTab/hooks/useAccessTab.ts | New hook to fetch role assignments with a short TTL cache and refresh support. |
| plugins/aks-desktop/src/components/AccessTab/AccessTab.tsx | New Access tab UI that renders role assignments, loading, and error states. |
Comments suppressed due to low confidence (1)
plugins/aks-desktop/src/index.tsx:420
- The comment says this delete button is for "ARM-managed projects only", but
isEnabledis stillisAksProject(managed-by: aks-desktop). Either updateisEnabledtoisArmManagedProjector adjust the comment so it matches the actual behavior.
// Register custom delete button for ARM-managed projects only
registerProjectDeleteButton({
isEnabled: isAksProject,
component: ({ project }) => <AKSProjectDeleteButton project={project} />,
});
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
plugins/aks-desktop/src/components/AccessTab/hooks/useAccessTab.ts
Outdated
Show resolved
Hide resolved
13 tasks
4a99e97 to
ac8a3c9
Compare
ac8a3c9 to
9b489a6
Compare
9b489a6 to
d5bc6ec
Compare
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 28 out of 28 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
plugins/aks-desktop/src/components/AccessTab/hooks/useAccessTab.ts
Outdated
Show resolved
Hide resolved
plugins/aks-desktop/src/components/AccessTab/hooks/useAccessTab.ts
Outdated
Show resolved
Hide resolved
d5bc6ec to
e0928f7
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR registers a custom AccesTab component on projects that are managed by ARM so that we can accurately fetch & display Azure Role Assignments to the user, specifically on AKSD projects that are managed, while preserving default k8s role access tab for non-managed AKSD projects.
Type of Change
Related Issues
Closes #[issue number]
Related to #[issue number]
Changes Made
listNamespaceRoleAssignmentsutility functionAccessTabwithuseAccessTabhook for populationindex.tsxisArmManagedprojectto distinguish between regular ASKD projects & managed ones.Testing
Test Cases
Describe the test cases that were run:
Screenshots/Videos
Checklist
Documentation Updates
Reviewer Notes
Any specific areas you'd like reviewers to focus on or questions you have.