From 11d0ffea2aa133a3284a8e89627098bd247be443 Mon Sep 17 00:00:00 2001 From: Marco Dinis Date: Mon, 11 Nov 2024 14:41:42 +0000 Subject: [PATCH] EKS Auto Enroll: wait for agent to be installed (#48734) After doing this flow a couple of times, it seems that 6 seconds is not enough. It should not take longer than 20 seconds. --- lib/integrations/awsoidc/eks_enroll_clusters.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/integrations/awsoidc/eks_enroll_clusters.go b/lib/integrations/awsoidc/eks_enroll_clusters.go index e3cc9e355ab73..1114d8764ba01 100644 --- a/lib/integrations/awsoidc/eks_enroll_clusters.go +++ b/lib/integrations/awsoidc/eks_enroll_clusters.go @@ -565,12 +565,13 @@ func checkAgentAlreadyInstalled(ctx context.Context, actionConfig *action.Config var err error // We setup a little backoff loop because sometimes access entry auth needs a bit more time to propagate and take // effect, so we could get errors when trying to access cluster right after giving us permissions to do so. + // From real scenarios, we've seen this taking as long as 20 seconds. for attempt := 1; attempt <= 3; attempt++ { listCmd := action.NewList(actionConfig) releases, err = listCmd.Run() if err != nil { select { - case <-time.After(time.Duration(attempt) * time.Second): + case <-time.After(time.Duration(attempt*5) * time.Second): case <-ctx.Done(): return false, trace.NewAggregate(err, ctx.Err()) }