CORS-4058: Remove AWS SDK V1 from destroy/aws#9736
CORS-4058: Remove AWS SDK V1 from destroy/aws#9736openshift-merge-bot[bot] merged 10 commits intoopenshift:mainfrom
Conversation
|
@barbacbd: This pull request references CORS-4058 which is a valid jira issue. DetailsIn response to this: Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
585e593 to
a027c22
Compare
|
/cc @patrickdillon |
|
/label platform/aws |
|
/approve I will look at this again, mostly just sanity checking to tag. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: patrickdillon The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
/retest-required |
tthvo
left a comment
There was a problem hiding this comment.
Thanks for handling such a substantial change! I have some questions/comments below but LGTM overall!
| if lastErr != nil { | ||
| return lastErr | ||
| } |
There was a problem hiding this comment.
Question: Should we requeue the tagclient for retrying if an error ocurrs? IIUC, previously we did that here?
If so, we should also check if the error is an AWS InvalidParameter error to skip requeueing. That said, I think, this PR, on line 73, the paginator error should be assigned to lastError and break the paging loop early.
5b2a3fa to
538c582
Compare
pkg/destroy/aws/iamhelpers.go
Outdated
| switch { | ||
| case strings.Contains(handleErrorCode(err), "NoSuchEntity"): | ||
| // The user does not exist. | ||
| // Ignore this IAM Role and do not report this error via lastError. |
There was a problem hiding this comment.
| // Ignore this IAM Role and do not report this error via lastError. | |
| // Ignore this IAM User and do not report this error via lastError. |
pkg/destroy/aws/iamhelpers.go
Outdated
| // Installer does not have access to this IAM role. | ||
| // Ignore this IAM Role and do not report this error via lastError. |
There was a problem hiding this comment.
| // Installer does not have access to this IAM role. | |
| // Ignore this IAM Role and do not report this error via lastError. | |
| // Installer does not have access to this IAM user. | |
| // Ignore this IAM User and do not report this error via lastError. |
pkg/destroy/aws/shared.go
Outdated
| for paginator.HasMorePages() { | ||
| page, err := paginator.NextPage(ctx) | ||
| if err != nil { | ||
| return fmt.Errorf("failed to get resources: %w", err) |
There was a problem hiding this comment.
I think the InvalidParameterException will likely come from here right? We should assign the error to lastError and break to check for requeueing?
d10fbce to
00bbf4a
Compare
|
/hold cancel I reviewed again and this looks good to me. It needs a rebase in the vendoring. There are multiple vendoring commits, so this is a probably a good opportunity to squash those. There are also a few places where the changes are revised between multiple commits, so you may want to squash those too. |
** the bulk of the changes are to the ec2helpers file. All of the sdk v1 imports are removed except for session as this one is engrained too many files currently. pkg/destroy/aws/aws.go ** Add a client for ELB ELBV2 and IAM to the Cluster Removal Struct. Even though these changes are mainly to ec2helpers, the other clients were required in for certain operations. ** The rest of the file updates are alter ARN import to come from aws sdk v2.
** Remove/Change all imports from AWS sdk v1 to v2. pkg/destroy/aws/errors.go pkg/destroy/aws/ec2helpers.go ** Remove the Error checking/formatting function from ec2helpers and put the function in the errors.go file.
** Remove all SDK v1 imports from elb helpers.
** This caused updates to other packages such as aws/config, credentials, stscreds, and a list of aws internal packages.
** Update Route53, s3, and efs services to sdk v2. This is slowly removing the requirement for aws session.
pkg/destroy/aws: ** Alter the function name from HandleErrorCode to handleErrorCode. The initial thought was that this function could be used in other areas of the code, but it will remain in destroy for now. pkg/destroy/aws/shared.go: ** Remove the session import and uses in the file.
** Remove session from the imports. Added the agent handler to the configurations.
|
/lgtm |
|
@barbacbd: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
4e8d67e
into
openshift:main
|
[ART PR BUILD NOTIFIER] Distgit: ose-installer |
|
[ART PR BUILD NOTIFIER] Distgit: ose-baremetal-installer |
|
[ART PR BUILD NOTIFIER] Distgit: ose-installer-artifacts |
no-jira: Revert "Merge pull request #9736 from barbacbd/CORS-4058"
No description provided.