Skip to content

Commit

Permalink
[v15] Add improvements for the EKS Discover UI. (#38687)
Browse files Browse the repository at this point in the history
* Add improvements for the EKS Discover UI.

* Add comment about Web UI relying on the text of an error.

* Change wording.

Co-authored-by: Yassine Bounekhla <[email protected]>

* Remove usage of negative margin.

---------

Co-authored-by: Yassine Bounekhla <[email protected]>
  • Loading branch information
AntonAM and rudream authored Feb 27, 2024
1 parent 1de2d8a commit dbd100e
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
1 change: 1 addition & 0 deletions lib/integrations/awsoidc/eks_enroll_clusters.go
Original file line number Diff line number Diff line change
Expand Up @@ -329,6 +329,7 @@ func enrollEKSCluster(ctx context.Context, log logrus.FieldLogger, clock clockwo
if alreadyInstalled, err := clt.CheckAgentAlreadyInstalled(ctx, kubeClientGetter, log); err != nil {
return "", trace.Wrap(err, "could not check if teleport-kube-agent is already installed.")
} else if alreadyInstalled {
// Web UI relies on the text of this error message. If changed, sync with EnrollEksCluster.tsx
return "", trace.AlreadyExists("teleport-kube-agent is already installed on the cluster %q", clusterName)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
*/

import React, { useState, useCallback } from 'react';
import { Box, ButtonSecondary, ButtonText, Text, Toggle } from 'design';
import { Box, ButtonSecondary, ButtonText, Link, Text, Toggle } from 'design';
import styled from 'styled-components';
import { FetchStatus } from 'design/DataTable/types';
import { Danger } from 'design/Alert';
Expand Down Expand Up @@ -218,7 +218,12 @@ export function EnrollEksCluster(props: AgentStepProps) {
emitErrorEvent(
'unknown error: no results came back from enrolling the EKS cluster.'
);
} else if (result.error) {
} else if (
result.error &&
!result.error.message.includes(
'teleport-kube-agent is already installed on the cluster'
)
) {
setEnrollmentState({
status: 'error',
error: `Cluster enrollment error: ${result.error}`,
Expand Down Expand Up @@ -294,6 +299,17 @@ export function EnrollEksCluster(props: AgentStepProps) {
<Danger mt={3}>{fetchClustersAttempt.statusText}</Danger>
)}
<Text mt={4}>
<b>Note:</b> EKS enrollment will work only with clusters that have
access entries authentication mode enabled, see{' '}
<Link
href="https://docs.aws.amazon.com/eks/latest/userguide/access-entries.html#authentication-modes"
target="_blank"
color="text.main"
>
documentation.
</Link>
</Text>
<Text mt={1}>
Select the AWS Region you would like to see EKS clusters for:
</Text>
<AwsRegionSelector
Expand Down Expand Up @@ -346,7 +362,7 @@ export function EnrollEksCluster(props: AgentStepProps) {
}}
pl={0}
>
Or click here to see instructions for manual enrollment
Or enroll manually
</ButtonText>
</Box>
</StyledBox>
Expand Down

0 comments on commit dbd100e

Please sign in to comment.