Skip to content

Commit

Permalink
Merge pull request #5995 from rna-afk/aws_fix_untag_loop
Browse files Browse the repository at this point in the history
Bug 2070744: Fix infinite loop when failing to untag resources
  • Loading branch information
openshift-merge-robot authored Sep 2, 2022
2 parents e2f9b43 + 609be18 commit f2e5195
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions pkg/destroy/aws/shared.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (

"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/aws/arn"
"github.com/aws/aws-sdk-go/aws/awserr"
"github.com/aws/aws-sdk-go/aws/session"
"github.com/aws/aws-sdk-go/service/iam"
"github.com/aws/aws-sdk-go/service/resourcegroupstaggingapi"
Expand Down Expand Up @@ -92,8 +93,14 @@ func (o *ClusterUninstaller) removeSharedTag(ctx context.Context, session *sessi
},
)
if err != nil {
err = errors.Wrap(err, "get tagged resources")
o.Logger.Info(err)
err2 := errors.Wrap(err, "get tagged resources")
o.Logger.Info(err2)
if aerr, ok := err.(awserr.Error); ok {
switch aerr.Code() {
case resourcegroupstaggingapi.ErrorCodeInvalidParameterException:
continue
}
}
nextTagClients = append(nextTagClients, tagClient)
continue
}
Expand Down

0 comments on commit f2e5195

Please sign in to comment.