You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit eb2f39b
Browse filesBrowse the repository at this point in the historyBrowse files
When Radar cannot connect to an EKS cluster due to credential failure,
the suggested `aws sso login` command now includes `--profile <name>`
when the kubeconfig exec block pins a profile via the AWS_PROFILE env
var or a --profile argument.
`aws eks update-kubeconfig` always injects the profile as AWS_PROFILE in
the exec env block, so this covers the common real-world case.
## Description
Brief description of the changes in this PR.
## Type of change
- [ ] Bug fix (non-breaking change that fixes an issue)
- [x] New feature (non-breaking change that adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to change)
- [ ] Documentation update
## How has this been tested?
Describe the tests you ran to verify your changes.
- [ ] Tested locally with minikube/kind
- [ ] Tested against a remote cluster
- [x] Added/updated unit tests
## Checklist
- [ ] My code follows the project's coding standards
- [x] I have performed a self-review of my code
- [x] I have added comments where necessary
- [ ] My changes generate no new warnings
- [ ] Any dependent changes have been merged
## Related issues
Fixes #(issue number)
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Low Risk**
> User-facing hint text and read-only kubeconfig parsing; shell
interpolation is gated by an allowlist with tests for hostile profiles.
>
> **Overview**
> **EKS connection errors now suggest AWS CLI commands with the same
profile the kubeconfig exec block uses**, instead of assuming the
terminal’s default profile.
>
> The backend adds `awsProfile` on each context by parsing `aws` /
`aws-iam-authenticator` exec auth (`--profile` or `AWS_PROFILE`). For
the active context it prefers the snapshotted kubeconfig used at client
creation so the hint matches live credentials. The UI waits for contexts
to load, then threads `awsProfile` into EKS auth, auth-rejected, and
timeout hints (`aws sso login`, `aws eks update-kubeconfig`,
STS/describe diagnostics).
>
> New `isShellSafeAWSProfile` / `awsProfileFlag` allow slash-separated
SSO profile names but **omit** `--profile` when the value looks hostile,
matching existing context-name safety for terminal-run commands.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
713af24. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
---------
Co-authored-by: Fabian Chong <fabian.chong@grabtaxi.com>
Co-authored-by: Nadav Erell <nadaverell@gmail.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
'EKS returned HTTP 401, so Kubernetes could not authenticate this request.',
100
102
'The AWS credential may be missing, stale, or revoked, or its IAM principal may not be mapped through an EKS access entry or the cluster\'s legacy aws-auth configuration.',
101
103
'If the credential is current, ask a cluster admin to verify the mapping for the IAM principal used by this context.',
102
-
'The diagnostic uses the terminal\'s current AWS profile. If the kubeconfig exec block pins AWS_PROFILE or --role-arn, use that profile or role instead.',
104
+
profileFlag
105
+
? 'The commands below use the AWS profile pinned by this context\'s kubeconfig exec block. If it also pins --role-arn, inspect that role instead.'
106
+
: 'The diagnostic uses the terminal\'s current AWS profile. If the kubeconfig exec block pins AWS_PROFILE or --role-arn, use that profile or role instead.',
103
107
'API and API_AND_CONFIG_MAP modes use access entries; CONFIG_MAP mode uses the aws-auth ConfigMap.',
104
108
],
105
-
fallbackCommand: {label: 'If this context uses the current AWS SSO profile, re-login and retry:',command: 'aws sso login'},
109
+
fallbackCommand: {
110
+
label: profileFlag ? 'If this profile uses AWS SSO, re-login and retry:' : 'If this context uses the current AWS SSO profile, re-login and retry:',
0 commit comments