Check agent access rights
As a result of this issue, we want to have an API that would help to show if the agent's access rights work as expected:
- Agent access rights (as success status)
- Missing access rights to do X (as severity warning)
We'll need the information available on the getClusterAgent GraphQl query.
There are some concerns raised here: gitlab-org&8149 (comment 964186695)
Implementation guide
- The KAS cookie is already created when the user navigates to the agent page.
- The requested information should be added to the Integration status section.
- Implement connection to the cluster with the KAS cookie and proxy similar to how it's done on the Environments page.
- Don't connect to the cluster if the agent is not currently connected.
- Check the agent's access rights using Kubernetes can-I API from the frontend cluster-client library.
- Add a warning icon to the overall status if the agent lacks access rights.
- Add a separate loading icon to the access rights row as getting this information from the cluster might take more time.
- Add an error in case the cluster connection wasn't successful.
Edited by Anna Vovchenko