From c907d539e6892df47ed8447af899fec9f59d5e24 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Tue, 3 Sep 2019 11:35:39 -0700 Subject: [PATCH 1/2] pkg/types/aws/validation/platform: Include eu-north-1 RHCOS grew support for this in 905db73fdf (data/data/rhcos.json: update the bootimage to 420.8.20190708.2 for CRI-O 1.14, 2019-07-03, #1941). And until we get something like [1], we need this not-very-DRY bump to keep up. [1]: https://github.com/openshift/installer/pull/1528 --- pkg/types/aws/validation/platform.go | 14 +++++++------- pkg/types/validation/installconfig_test.go | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/pkg/types/aws/validation/platform.go b/pkg/types/aws/validation/platform.go index 79adb08ee5c..f4bb52decb9 100644 --- a/pkg/types/aws/validation/platform.go +++ b/pkg/types/aws/validation/platform.go @@ -24,13 +24,13 @@ var ( //"cn-north-1": "Beijing", //"cn-northwest-1": "Ningxia", "eu-central-1": "Frankfurt", - //"eu-north-1": "Stockholm", - "eu-west-1": "Ireland", - "eu-west-2": "London", - "eu-west-3": "Paris", - "sa-east-1": "São Paulo", - "us-east-1": "N. Virginia", - "us-east-2": "Ohio", + "eu-north-1": "Stockholm", + "eu-west-1": "Ireland", + "eu-west-2": "London", + "eu-west-3": "Paris", + "sa-east-1": "São Paulo", + "us-east-1": "N. Virginia", + "us-east-2": "Ohio", //"us-gov-east-1": "AWS GovCloud (US-East)", //"us-gov-west-1": "AWS GovCloud (US-West)", "us-west-1": "N. California", diff --git a/pkg/types/validation/installconfig_test.go b/pkg/types/validation/installconfig_test.go index 77e768486f9..6bf4d3dd31c 100644 --- a/pkg/types/validation/installconfig_test.go +++ b/pkg/types/validation/installconfig_test.go @@ -408,7 +408,7 @@ func TestValidateInstallConfig(t *testing.T) { } return c }(), - expectedError: `^platform\.aws\.region: Unsupported value: "": supported values: "ap-northeast-1", "ap-northeast-2", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ca-central-1", "eu-central-1", "eu-west-1", "eu-west-2", "eu-west-3", "sa-east-1", "us-east-1", "us-east-2", "us-west-1", "us-west-2"$`, + expectedError: `^platform\.aws\.region: Unsupported value: "": supported values: "ap-northeast-1", "ap-northeast-2", "ap-south-1", "ap-southeast-1", "ap-southeast-2", "ca-central-1", "eu-central-1", "eu-north-1", "eu-west-1", "eu-west-2", "eu-west-3", "sa-east-1", "us-east-1", "us-east-2", "us-west-1", "us-west-2"$`, }, { name: "valid libvirt platform", From 612143d5ac7ef7d10e302935f67a86250dba2f4f Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Tue, 3 Sep 2019 14:27:01 -0700 Subject: [PATCH 2/2] platformtests/aws/default_instance_class_test: Add Bahrain (me-south-1) The region was added on 2019-07-29 [1] and the canonical ID is me-south-1 [2]. This fixes: $ cd platformtests/aws $ AWS_PROFILE=openshift-dev go test . --- FAIL: TestGetDefaultInstanceClass (71.40s) --- FAIL: TestGetDefaultInstanceClass/Middle_East_(Bahrain) (0.00s) default_instance_class_test.go:99: not a recognized region FAIL FAIL github.com/openshift/installer/platformtests/aws 71.420s And as a new region without m4 support, we need to set its default to m5 to avoid: $ AWS_PROFILE=openshift-dev go test . --- FAIL: TestGetDefaultInstanceClass (75.95s) --- FAIL: TestGetDefaultInstanceClass/Middle_East_(Bahrain) (1.96s) default_instance_class_test.go:107: no direct access to region, assuming full support: AuthFailure: AWS was not able to validate the provided access credentials status code: 401, request id: f05f9e76-2a63-40d1-8748-a67f6d637ba1 default_instance_class_test.go:121: map[m5:{} m5d:{} t3:{}] default_instance_class_test.go:122: Error Trace:default_instance_class_test.go:122 Error: Not equal: expected: "m4" actual : "m5" Diff: --- Expected +++ Actual @@ -1 +1 @@ -m4 +m5 Test: TestGetDefaultInstanceClass/Middle_East_(Bahrain) FAIL FAIL github.com/openshift/installer/platformtests/aws75.965s [1]: https://aws.amazon.com/about-aws/whats-new/2019/07/announcing-the-new-aws-middle-east--bahrain--region-/ [2]: https://github.com/aws/aws-sdk-go/commit/384f4536edd1f4b59cf0c03ab3b346aba4c1c9cc#diff-fe3b36d57dc4378fa7b13c85492f4119R49 --- pkg/types/aws/defaults/platform.go | 1 + pkg/types/aws/validation/platform.go | 7 ++++--- platformtests/aws/default_instance_class_test.go | 1 + 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/pkg/types/aws/defaults/platform.go b/pkg/types/aws/defaults/platform.go index be076c75355..74a218d0afd 100644 --- a/pkg/types/aws/defaults/platform.go +++ b/pkg/types/aws/defaults/platform.go @@ -10,6 +10,7 @@ var ( "ap-northeast-2": "m5", "eu-north-1": "m5", "eu-west-3": "m5", + "me-south-1": "m5", "us-gov-east-1": "m5", "us-west-2": "m5", } diff --git a/pkg/types/aws/validation/platform.go b/pkg/types/aws/validation/platform.go index f4bb52decb9..271263eaba3 100644 --- a/pkg/types/aws/validation/platform.go +++ b/pkg/types/aws/validation/platform.go @@ -28,9 +28,10 @@ var ( "eu-west-1": "Ireland", "eu-west-2": "London", "eu-west-3": "Paris", - "sa-east-1": "São Paulo", - "us-east-1": "N. Virginia", - "us-east-2": "Ohio", + //"me-south-1": "Bahrain", + "sa-east-1": "São Paulo", + "us-east-1": "N. Virginia", + "us-east-2": "Ohio", //"us-gov-east-1": "AWS GovCloud (US-East)", //"us-gov-west-1": "AWS GovCloud (US-West)", "us-west-1": "N. California", diff --git a/platformtests/aws/default_instance_class_test.go b/platformtests/aws/default_instance_class_test.go index c1fbbce2eb3..365646ead84 100644 --- a/platformtests/aws/default_instance_class_test.go +++ b/platformtests/aws/default_instance_class_test.go @@ -81,6 +81,7 @@ func TestGetDefaultInstanceClass(t *testing.T) { "Asia Pacific (Hong Kong)": "ap-east-1", "Asia Pacific (Osaka-Local)": "ap-northeast-3", "EU (Stockholm)": "eu-north-1", + "Middle East (Bahrain)": "me-south-1", "South America (Sao Paulo)": "sa-east-1", }