Skip to content

Commit

Permalink
Merge pull request #1116 from nimrod-becker/backport_to_5_11
Browse files Browse the repository at this point in the history
[Backport to 5.11] update aws regions
  • Loading branch information
nimrod-becker authored May 2, 2023
2 parents 749491f + 027f554 commit 9e4f8e3
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
uses: golangci/golangci-lint-action@v3
with:
# Required: the version of golangci-lint is required and must be specified without patch version: we always use the latest patch version.
version: v1.50
version: v1.52.2

# Optional: if set to true then the all caching functionality will be complete disabled,
# takes precedence over all other caching options.
Expand Down
10 changes: 10 additions & 0 deletions pkg/util/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -1071,6 +1071,8 @@ func GetIBMRegion() (string, error) {
func GetAWSRegion() (string, error) {
// parse the node name to get AWS region according to this:
// https://docs.aws.amazon.com/en_pv/vpc/latest/userguide/vpc-dns.html#vpc-dns-hostnames
// The list of regions can be found here:
// https://docs.aws.amazon.com/general/latest/gr/rande.html
var mapValidAWSRegions = map[string]string{
"compute-1": "us-east-1",
"ec2": "us-east-1",
Expand All @@ -1080,21 +1082,29 @@ func GetAWSRegion() (string, error) {
"us-west-2": "us-west-2",
"ca-central-1": "ca-central-1",
"eu-central-1": "eu-central-1",
"eu-central-2": "eu-central-2",
"eu-west-1": "eu-west-1",
"eu-west-2": "eu-west-2",
"eu-west-3": "eu-west-3",
"eu-north-1": "eu-north-1",
"eu-south-1": "eu-south-1",
"eu-south-2": "eu-south-2",
"ap-east-1": "ap-east-1",
"ap-northeast-1": "ap-northeast-1",
"ap-northeast-2": "ap-northeast-2",
"ap-northeast-3": "ap-northeast-3",
"ap-southeast-1": "ap-southeast-1",
"ap-southeast-2": "ap-southeast-2",
"ap-southeast-3": "ap-southeast-3",
"ap-southeast-4": "ap-southeast-4",
"ap-south-1": "ap-south-1",
"ap-south-2": "ap-south-2",
"me-south-1": "me-south-1",
"me-central-1": "me-central-1",
"sa-east-1": "sa-east-1",
"us-gov-west-1": "us-gov-west-1",
"us-gov-east-1": "us-gov-east-1",
"af-south-1": "af-south-1",
}
nodesList := &corev1.NodeList{}
if ok := KubeList(nodesList); !ok || len(nodesList.Items) == 0 {
Expand Down

0 comments on commit 9e4f8e3

Please sign in to comment.