-
Notifications
You must be signed in to change notification settings - Fork 1.5k
CORS-4055: migrate default region check to AWS SDK v2 #10267
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@tthvo: This pull request references CORS-4055 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. |
|
/cc @yunjiang29 |
|
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
|
|
/retest |
|
@liweinan can you do a pre-merge test against this PR? |
|
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)) |
|
/verified by liweinan |
|
@liweinan: This PR has been marked as verified by 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. |
patrickdillon
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/approve
/lgtm
|
[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 |
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.
0ef07df to
3330f83
Compare
|
@tthvo: 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. |
|
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))
|
|
/verified by liweinan |
|
@liweinan: This PR has been marked as verified by 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. |
|
/lgtm |
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.