Skip to content

Conversation

@tthvo
Copy link
Member

@tthvo tthvo commented Jan 28, 2026

The PR is an incremental step to migrate AWS API calls to AWS SDK v2. This only focuses on logics to get the default region from loaded config for the survey.

Note: This code path is applicable for the survey that asks the users for the install region.

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

openshift-ci-robot commented Jan 28, 2026

@tthvo: This pull request references CORS-4055 which is a valid jira issue.

Details

In response to this:

The PR is an incremental step to migrate AWS API calls to AWS SDK v2. This only focuses on logics to get the default region from loaded config for the survey.

Note: This code path is applicable for the survey that asks the users for the install region.

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.

@tthvo
Copy link
Member Author

tthvo commented Jan 28, 2026

/cc @yunjiang29
/label platform/aws

@tthvo
Copy link
Member Author

tthvo commented Jan 28, 2026

I did a quick local test and it worked as expected 👇

Minimal run - Default region should be from the AWS profile

 ./openshift-install create install-config --dir=.
? SSH Public Key <path>
? Platform aws
INFO Credentials loaded from the AWS config using "SharedConfigCredentials: <path>" provider 
? Region  [Use arrows to move, type to filter, ? for more help]
  me-south-1 (Middle East (Bahrain))
  mx-central-1 (Mexico (Central))
  sa-east-1 (South America (São Paulo))
> us-east-1 (US East (N. Virginia))
  us-east-2 (US East (Ohio))
  us-west-1 (US West (N. California))
  us-west-2 (US West (Oregon))

Explicit region - Default region should be the specified region

$ AWS_REGION=us-west-1 ./openshift-install create install-config --dir=.
? SSH Public Key <path>
? Platform aws
INFO Credentials loaded from the AWS config using "SharedConfigCredentials: <path>" provider 
? Region  [Use arrows to move, type to filter, ? for more help]
  me-south-1 (Middle East (Bahrain))
  mx-central-1 (Mexico (Central))
  sa-east-1 (South America (São Paulo))
  us-east-1 (US East (N. Virginia))
  us-east-2 (US East (Ohio))
> us-west-1 (US West (N. California))
  us-west-2 (US West (Oregon))

Explicit invalid region - Default region should fall back to us-east-1

AWS_REGION=us-west-13 ./openshift-install create install-config --dir=.
? SSH Public Key <path>
? Platform aws
INFO Credentials loaded from the AWS config using "SharedConfigCredentials: <path>" provider 
WARNING Unrecognized AWS region "us-west-13", defaulting to us-east-1 
? Region  [Use arrows to move, type to filter, ? for more help]
  me-south-1 (Middle East (Bahrain))
  mx-central-1 (Mexico (Central))
  sa-east-1 (South America (São Paulo))
> us-east-1 (US East (N. Virginia))
  us-east-2 (US East (Ohio))
  us-west-1 (US West (N. California))
  us-west-2 (US West (Oregon))

@tthvo
Copy link
Member Author

tthvo commented Jan 28, 2026

/retest

@yunjiang29
Copy link
Contributor

@liweinan can you do a pre-merge test against this PR?

@liweinan
Copy link

Verification process:

weli@tower ~/works/oc-swarm/installer (release-4.20) 
❯ git checkout CORS-4055-region  
Updating files: 100% (48308/48308), done.
branch 'CORS-4055-region' set up to track 'thvo/CORS-4055-region'.
Switched to a new branch 'CORS-4055-region'

weli@tower ~/works/oc-swarm/installer (CORS-4055-region) 
❯ hack/build.sh
++ dirname hack/build.sh
+ . hack/build-cluster-api.sh
++ set -e
+++ go env GOOS
+++ go env GOARCH
++ TARGET_OS_ARCH=darwin_arm64
++ CLUSTER_API_BIN_DIR=/Users/weli/works/oc-swarm/installer/cluster-api/bin/darwin_arm64
++ CLUSTER_API_MIRROR_DIR=/Users/weli/works/oc-swarm/installer/pkg/clusterapi/mirror/
++ ENVTEST_K8S_VERSION=1.32.0
+++ go env GOOS

+ go build -mod=vendor -gcflags '' -ldflags ' -X github.com/openshift/installer/pkg/version.Raw=v1.4.21-pre-154-g0ef07df61901d7b2e0857378101730de80c5db80 -X github.com/openshift/installer/pkg/version.Commit=0ef07df61901d7b2e0857378101730de80c5db80 -X github.com/openshift/installer/pkg/version.defaultArch=amd64 -s -w' -tags ' release' -o bin/openshift-install ./cmd/openshift-install

weli@tower ~/works/oc-swarm/installer/bin (CORS-4055-region) 
❯ ./openshift-install version
./openshift-install v1.4.21-pre-154-g0ef07df61901d7b2e0857378101730de80c5db80
built from commit 0ef07df61901d7b2e0857378101730de80c5db80
release image registry.ci.openshift.org/origin/release:4.21
WARNING Release Image Architecture not detected. Release Image Architecture is unknown 
release architecture unknown
default architecture amd64

❯ aws configure get region
us-east-1
weli@tower ~/works/oc-swarm/installer/bin (CORS-4055-region) 
❯ ./openshift-install create install-config
? SSH Public Key /Users/weli/.ssh/id_rsa.pub
? Platform aws
INFO Credentials loaded from the AWS config using "SharedConfigCredentials: /Users/weli/.aws/credentials" provider 
? Region  [Use arrows to move, type to filter, ? for more help]
  me-south-1 (Middle East (Bahrain))
  mx-central-1 (Mexico (Central))
  sa-east-1 (South America (São Paulo))
> us-east-1 (US East (N. Virginia))
  us-east-2 (US East (Ohio))
  us-west-1 (US West (N. California))
  us-west-2 (US West (Oregon))

weli@tower ~/works/oc-swarm/installer/bin (CORS-4055-region) 
❯ AWS_REGION=us-west-1 ./openshift-install create install-config --dir=.
? SSH Public Key /Users/weli/.ssh/id_rsa.pub
? Platform aws
INFO Credentials loaded from the AWS config using "SharedConfigCredentials: /Users/weli/.aws/credentials" provider 
? Region  [Use arrows to move, type to filter, ? for more help]
  me-south-1 (Middle East (Bahrain))
  mx-central-1 (Mexico (Central))
  sa-east-1 (South America (São Paulo))
  us-east-1 (US East (N. Virginia))
  us-east-2 (US East (Ohio))
> us-west-1 (US West (N. California))
  us-west-2 (US West (Oregon))

weli@tower ~/works/oc-swarm/installer/bin (CORS-4055-region) 
❯ AWS_REGION=us-west-404 ./openshift-install create install-config --dir=.
? SSH Public Key /Users/weli/.ssh/id_rsa.pub
? Platform aws
INFO Credentials loaded from the AWS config using "SharedConfigCredentials: /Users/weli/.aws/credentials" provider 
WARNING Unrecognized AWS region "us-west-404", defaulting to us-east-1 
? Region  [Use arrows to move, type to filter, ? for more help]
  me-south-1 (Middle East (Bahrain))
  mx-central-1 (Mexico (Central))
  sa-east-1 (South America (São Paulo))
> us-east-1 (US East (N. Virginia))
  us-east-2 (US East (Ohio))
  us-west-1 (US West (N. California))
  us-west-2 (US West (Oregon))

@liweinan
Copy link

/verified by liweinan

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

@liweinan: This PR has been marked as verified by liweinan.

Details

In response to this:

/verified by liweinan

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

@patrickdillon patrickdillon left a comment

Choose a reason for hiding this comment

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

/approve
/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 30, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 30, 2026

[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

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

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 30, 2026
The commit is an incremental step to migrate AWS API calls
to AWS SDK v2. This only focuses on logics to get the default region
from loaded config for the survey.
@openshift-ci-robot openshift-ci-robot removed the verified Signifies that the PR passed pre-merge verification criteria label Jan 30, 2026
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Jan 30, 2026
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 31, 2026

@tthvo: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aws-ovn 3330f83 link true /test e2e-aws-ovn
ci/prow/e2e-aws-ovn-edge-zones 3330f83 link false /test e2e-aws-ovn-edge-zones
ci/prow/images 3330f83 link true /test images
ci/prow/e2e-aws-ovn-heterogeneous 3330f83 link false /test e2e-aws-ovn-heterogeneous

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.

@liweinan
Copy link

Verification:

weli@tower ~/works/oc-swarm/installer/bin (CORS-4055-region) 
❯ ./openshift-install version
./openshift-install v1.4.21-pre-158-g3330f83b95bc1e72753ac254ee5cca00b6b9ceba
built from commit 3330f83b95bc1e72753ac254ee5cca00b6b9ceba
release image registry.ci.openshift.org/origin/release:4.21
WARNING Release Image Architecture not detected. Release Image Architecture is unknown 
release architecture unknown
default architecture amd64
weli@tower ~/works/oc-swarm/installer/bin (CORS-4055-region) 
❯ aws configure get region
us-east-1
weli@tower ~/works/oc-swarm/installer/bin (CORS-4055-region) 

---

weli@tower ~/works/oc-swarm/installer/bin (CORS-4055-region) 
❯ ./openshift-install create install-config
? SSH Public Key /Users/weli/.ssh/id_rsa.pub
? Platform aws
INFO Credentials loaded from the AWS config using "SharedConfigCredentials: /Users/weli/.aws/credentials" provider 
? Region  [Use arrows to move, type to filter, ? for more help]
  me-south-1 (Middle East (Bahrain))
  mx-central-1 (Mexico (Central))
  sa-east-1 (South America (São Paulo))
> us-east-1 (US East (N. Virginia))
  us-east-2 (US East (Ohio))
  us-west-1 (US West (N. California))
  us-west-2 (US West (Oregon))

---

weli@tower ~/works/oc-swarm/installer/bin (CORS-4055-region) 
❯ AWS_REGION=us-west-1 ./openshift-install create install-config --dir=.
? SSH Public Key /Users/weli/.ssh/id_rsa.pub
? Platform aws
INFO Credentials loaded from the AWS config using "SharedConfigCredentials: /Users/weli/.aws/credentials" provider 
? Region  [Use arrows to move, type to filter, ? for more help]
  me-south-1 (Middle East (Bahrain))
  mx-central-1 (Mexico (Central))
  sa-east-1 (South America (São Paulo))
  us-east-1 (US East (N. Virginia))
  us-east-2 (US East (Ohio))
> us-west-1 (US West (N. California))
  us-west-2 (US West (Oregon))

---

weli@tower ~/works/oc-swarm/installer/bin (CORS-4055-region) 
❯ AWS_REGION=us-west-404 ./openshift-install create install-config --dir=.
? SSH Public Key /Users/weli/.ssh/id_rsa.pub
? Platform aws
INFO Credentials loaded from the AWS config using "SharedConfigCredentials: /Users/weli/.aws/credentials" provider 
WARNING Unrecognized AWS region "us-west-404", defaulting to us-east-1 
? Region  [Use arrows to move, type to filter, ? for more help]
  me-south-1 (Middle East (Bahrain))
  mx-central-1 (Mexico (Central))
  sa-east-1 (South America (São Paulo))
> us-east-1 (US East (N. Virginia))
  us-east-2 (US East (Ohio))
  us-west-1 (US West (N. California))
  us-west-2 (US West (Oregon))

@liweinan
Copy link

/verified by liweinan

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

@liweinan: This PR has been marked as verified by liweinan.

Details

In response to this:

/verified by liweinan

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.

@liweinan
Copy link

/lgtm

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

/retest-required

Remaining retests: 0 against base HEAD 5314736 and 2 for PR HEAD 3330f83 in total

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. 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. platform/aws verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants