Skip to content

CNTRLPLANE-2076: remove v2 import aliases left from SDK migration#8063

Open
LiangquanLi930 wants to merge 1 commit intoopenshift:mainfrom
LiangquanLi930:cleanup-2
Open

CNTRLPLANE-2076: remove v2 import aliases left from SDK migration#8063
LiangquanLi930 wants to merge 1 commit intoopenshift:mainfrom
LiangquanLi930:cleanup-2

Conversation

@LiangquanLi930
Copy link
Member

@LiangquanLi930 LiangquanLi930 commented Mar 25, 2026

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes

Special notes for your reviewer:

Checklist:

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

Summary by CodeRabbit

Refactor

  • Updated internal AWS SDK package references throughout the codebase by removing import aliases and adopting direct package imports across infrastructure utilities, control-plane operations, and test components to improve code consistency and maintainability.

@openshift-ci-robot
Copy link

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: LGTM mode

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Mar 25, 2026
@openshift-ci-robot
Copy link

openshift-ci-robot commented Mar 25, 2026

@LiangquanLi930: This pull request references CNTRLPLANE-2076 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes

Special notes for your reviewer:

Checklist:

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

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.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 25, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: 6fd1e548-7e27-40af-badb-d1cfcf5fea66

📥 Commits

Reviewing files that changed from the base of the PR and between 4ce92a2 and 696ea2e.

📒 Files selected for processing (13)
  • cmd/fix/dr_oidc_iam.go
  • cmd/infra/aws/destroy_test.go
  • cmd/infra/aws/util/errors.go
  • cmd/infra/aws/util/sts.go
  • cmd/infra/aws/util/sts_test.go
  • cmd/infra/aws/util/util.go
  • cmd/infra/aws/util/util_test.go
  • control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go
  • support/awsutil/sts.go
  • test/e2e/util/fixture.go
  • test/e2e/util/reqserving/setup.go
  • test/e2e/util/sharedoidc.go
  • test/e2e/util/util.go
✅ Files skipped from review due to trivial changes (8)
  • test/e2e/util/sharedoidc.go
  • cmd/infra/aws/destroy_test.go
  • cmd/infra/aws/util/errors.go
  • cmd/infra/aws/util/util_test.go
  • support/awsutil/sts.go
  • test/e2e/util/util.go
  • test/e2e/util/reqserving/setup.go
  • cmd/infra/aws/util/sts_test.go
🚧 Files skipped from review as they are similar to previous changes (2)
  • test/e2e/util/fixture.go
  • control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go

📝 Walkthrough

Walkthrough

The pull request removes aliased imports of AWS SDK v2 packages throughout the codebase and replaces them with direct package imports. Aliased imports such as awsv2, configv2, route53v2, and stsv2 are replaced with unaliased imports like aws, config, route53, and sts. This change is propagated across function signatures (particularly in exported functions like NewSTSSession, ParseSTSCredentialsFile, and GetSession), internal helper functions, test code, and all call sites. Type references are updated mechanically from aliased forms (e.g., *awsv2.Config) to unaliased forms (e.g., *aws.Config). Control flow, error handling, and business logic remain unchanged.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci openshift-ci bot requested review from jparrill and sjenning March 25, 2026 06:39
@openshift-ci openshift-ci bot added area/cli Indicates the PR includes changes for CLI area/control-plane-operator Indicates the PR includes changes for the control plane operator - in an OCP release area/hypershift-operator Indicates the PR includes changes for the hypershift operator and API - outside an OCP release area/platform/aws PR/issue for AWS (AWSPlatform) platform area/testing Indicates the PR includes changes for e2e testing and removed do-not-merge/needs-area labels Mar 25, 2026
@openshift-ci-robot
Copy link

openshift-ci-robot commented Mar 25, 2026

@LiangquanLi930: This pull request references CNTRLPLANE-2076 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes

Special notes for your reviewer:

Checklist:

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

Summary by CodeRabbit

Release Notes

  • Refactor

  • Standardized AWS SDK v2 dependency usage across the codebase to improve code consistency and maintainability. Internal implementations were updated to use direct package imports, with no impact on user-facing functionality or behavior.

  • Tests

  • Updated test suites to align with the standardized AWS SDK v2 usage patterns.

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.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@cmd/infra/aws/util/util.go`:
- Around line 115-116: The NewSession function currently discards the error from
config.LoadDefaultConfig; change NewSession to return (*aws.Config, error),
capture and return the error from config.LoadDefaultConfig (do not ignore it),
and update the GetSession wrapper and all 19 call sites and tests to propagate
or handle the returned error accordingly so callers no longer receive a
seemingly valid config when loading fails; reference the NewSession function,
GetSession wrapper, and any call sites invoking NewSession to locate updates.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro

Run ID: e1e5336a-1a64-417e-8a22-cce05553b2a4

📥 Commits

Reviewing files that changed from the base of the PR and between 1375a78 and b22fa76.

📒 Files selected for processing (13)
  • cmd/fix/dr_oidc_iam.go
  • cmd/infra/aws/destroy_test.go
  • cmd/infra/aws/util/errors.go
  • cmd/infra/aws/util/sts.go
  • cmd/infra/aws/util/sts_test.go
  • cmd/infra/aws/util/util.go
  • cmd/infra/aws/util/util_test.go
  • control-plane-operator/controllers/awsprivatelink/awsprivatelink_controller.go
  • support/awsutil/sts.go
  • test/e2e/util/fixture.go
  • test/e2e/util/reqserving/setup.go
  • test/e2e/util/sharedoidc.go
  • test/e2e/util/util.go

Copy link
Contributor

@jparrill jparrill left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 25, 2026
@LiangquanLi930
Copy link
Member Author

/pipeline required

@openshift-ci-robot
Copy link

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-aks-4-21
/test e2e-aws-4-21
/test e2e-aks
/test e2e-aws
/test e2e-aws-upgrade-hypershift-operator
/test e2e-kubevirt-aws-ovn-reduced
/test e2e-v2-aws

@LiangquanLi930
Copy link
Member Author

/test e2e-azure-self-managed

@cwbotbot
Copy link

cwbotbot commented Mar 25, 2026

Test Results

e2e-aws

e2e-aks

Copy link
Contributor

@sdminonne sdminonne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A good follow-up fix would be changing NewSession to return (*aws.Config, error)
Stopping swallowing error and make the rabbit happy :)

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 25, 2026
@openshift-ci-robot
Copy link

Tests from second stage were triggered manually. Pipeline can be controlled only manually, until HEAD changes. Use command to trigger second stage.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 25, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jparrill, LiangquanLi930, sdminonne

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@sdminonne
Copy link
Contributor

/lgtm

@LiangquanLi930
Copy link
Member Author

/retest

@LiangquanLi930
Copy link
Member Author

/verified by e2e

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Mar 25, 2026
@openshift-ci-robot
Copy link

@LiangquanLi930: This PR has been marked as verified by e2e.

Details

In response to this:

/verified by e2e

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.

@sdminonne
Copy link
Contributor

/lgtm

@LiangquanLi930
Copy link
Member Author

/retest

@LiangquanLi930
Copy link
Member Author

/test e2e-aks

@openshift-ci-robot openshift-ci-robot removed the verified Signifies that the PR passed pre-merge verification criteria label Mar 26, 2026
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Mar 26, 2026
@openshift-ci-robot
Copy link

openshift-ci-robot commented Mar 26, 2026

@LiangquanLi930: This pull request references CNTRLPLANE-2076 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes

Special notes for your reviewer:

Checklist:

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

Summary by CodeRabbit

  • Refactor

  • Standardized AWS SDK v2 usage across the codebase (imports and types), improving consistency and maintainability with no user-facing behavior changes.

  • Tests

  • Updated existing tests to match the SDK changes and added comprehensive Route53 unit tests to strengthen DNS-related coverage and reliability.

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.

Drop awsv2, ec2v2, route53v2, stsv2, configv2 and other
transitional aliases across 13 files; packages now use their
idiomatic names.

Signed-off-by: Liangquan Li <liangli@redhat.com>
@YuLi517
Copy link

YuLi517 commented Mar 26, 2026

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Mar 26, 2026
@openshift-ci-robot
Copy link

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-aks-4-21
/test e2e-aws-4-21
/test e2e-aks
/test e2e-aws
/test e2e-aws-upgrade-hypershift-operator
/test e2e-kubevirt-aws-ovn-reduced
/test e2e-v2-aws

@LiangquanLi930
Copy link
Member Author

/verified by e2e

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Mar 26, 2026
@openshift-ci-robot
Copy link

@LiangquanLi930: This PR has been marked as verified by e2e.

Details

In response to this:

/verified by e2e

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.

@openshift-ci-robot
Copy link

openshift-ci-robot commented Mar 26, 2026

@LiangquanLi930: This pull request references CNTRLPLANE-2076 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the story to target the "4.22.0" version, but no target version was set.

Details

In response to this:

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes

Special notes for your reviewer:

Checklist:

  • Subject and description added to both, commit and PR.
  • Relevant issues have been referenced.
  • This change includes docs.
  • This change includes unit tests.

Summary by CodeRabbit

Refactor

  • Updated internal AWS SDK package references throughout the codebase by removing import aliases and adopting direct package imports across infrastructure utilities, control-plane operations, and test components to improve code consistency and maintainability.

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.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Mar 26, 2026

@LiangquanLi930: all tests passed!

Full PR test history. Your PR dashboard.

Details

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 kubernetes-sigs/prow repository. I understand the commands that are listed here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. area/cli Indicates the PR includes changes for CLI area/control-plane-operator Indicates the PR includes changes for the control plane operator - in an OCP release area/hypershift-operator Indicates the PR includes changes for the hypershift operator and API - outside an OCP release area/platform/aws PR/issue for AWS (AWSPlatform) platform area/testing Indicates the PR includes changes for e2e testing jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants