Skip to content

Commit

Permalink
Merge pull request #330 from bmsiegel/request-in-progress
Browse files Browse the repository at this point in the history
Retry on RequestInProgressException
  • Loading branch information
cert-manager-prow[bot] authored Jul 16, 2024
2 parents 179e6a7 + d771ea3 commit 33f04e5
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/controllers/genericissuer_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,10 @@ import (
"os"

"github.com/aws/aws-sdk-go-v2/aws"
"github.com/aws/aws-sdk-go-v2/aws/retry"
"github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/credentials"
acmpcaTypes "github.com/aws/aws-sdk-go-v2/service/acmpca/types"
"github.com/aws/aws-sdk-go-v2/service/sts"
api "github.com/cert-manager/aws-privateca-issuer/pkg/api/v1beta1"
awspca "github.com/cert-manager/aws-privateca-issuer/pkg/aws"
Expand Down Expand Up @@ -86,6 +88,10 @@ func (r *GenericIssuerReconciler) Reconcile(ctx context.Context, req ctrl.Reques
return ctrl.Result{}, cfgErr
}

cfg.Retryer = func() aws.Retryer {
return retry.AddWithErrorCodes(retry.NewStandard(), (*acmpcaTypes.RequestInProgressException)(nil).ErrorCode())
}

if r.GetCallerIdentity {
id, err := sts.NewFromConfig(cfg).GetCallerIdentity(ctx, &sts.GetCallerIdentityInput{})
if err != nil {
Expand Down

0 comments on commit 33f04e5

Please sign in to comment.