-
Notifications
You must be signed in to change notification settings - Fork 70
Description
Summary
When the extension cannot list namespaces due to RBAC permissions, the wizard currently surfaces a raw kubectl forbidden error and blocks progress.
This should be handled more gracefully so users are not forced to go deeper into the wizard just to discover they lack namespace-list permissions.
Current behavior
During wizard flow, namespace retrieval fails with:
Failed to retrieve namespaces from cluster: The command "kubectl get namespace -o json" returned status code 1 Error: Error from server (Forbidden): namespaces is forbidden: User "xxx@microsoft.com" cannot list resource "namespaces" in API group "" at the cluster scope: User does not have access to the resource in Azure. Update role assignment to allow access.
Expected behavior
If namespace listing fails with Forbidden:
- Show a concise, user-friendly message.
- Explain that this is likely an RBAC permission issue.
- Offer actionable next steps (for example: required role/permission, link/button to docs).
- Allow fallback behavior instead of hard-blocking the wizard (for example: manual namespace entry, skip namespace step, or continue with default options where safe).
- Avoid exposing the full raw kubectl error by default (optionally available under “Details”).
Why this matters
Users with limited RBAC are common in enterprise environments.
A graceful experience would reduce confusion and prevent unnecessary failure in guided flows.
Repro steps
- Use an AKS cluster where the signed-in user does not have permission to list namespaces at cluster scope.
- Start the related wizard flow in the extension that requires namespace retrieval.
- Observe the failure toast/error and blocked progression.
Possible/Suggested acceptance criteria
- Forbidden namespace-list errors are detected and mapped to a friendly UX message.
- Wizard presents at least one non-blocking fallback path.
- Raw error text is hidden behind an optional details affordance.
- Telemetry includes a distinct error reason for RBAC namespace-list denial.
