Skip to content

Commit

Permalink
Enroll EKS Cluster from Discover: wait for access entry (#49473)
Browse files Browse the repository at this point in the history
After running this flow a couple more times, we discovered that some
times it takes longer than 25s.
From multiple tests we found out that it can take up to 30s.
Instead of setting that as the wait time, we add a little more to ensure
we are more resilient.
  • Loading branch information
marcoandredinis authored Nov 27, 2024
1 parent 5bfc4d8 commit e146525
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/integrations/awsoidc/eks_enroll_clusters.go
Original file line number Diff line number Diff line change
Expand Up @@ -552,13 +552,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++ {
// From real scenarios, we've seen this taking as long as 30 seconds.
for attempt := 1; attempt <= 6; attempt++ {
listCmd := action.NewList(actionConfig)
releases, err = listCmd.Run()
if err != nil {
select {
case <-time.After(time.Duration(attempt*5) * time.Second):
case <-time.After(10 * time.Second):
case <-ctx.Done():
return false, trace.NewAggregate(err, ctx.Err())
}
Expand Down

0 comments on commit e146525

Please sign in to comment.