Merge pull request #3772 from loganhz/eks-china

[Master] Support EKS cn-northwest-1 and cn-north-1
This commit is contained in:
Westly Wright 2020-04-07 10:27:23 -07:00 committed by GitHub
commit e8eee13c37
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 1 deletions

View File

@ -11,7 +11,7 @@ import { inject as service } from '@ember/service';
import $ from 'jquery';
import { isEmpty } from '@ember/utils';
const REGIONS = ['us-east-2', 'us-east-1', 'us-west-2', 'ap-east-1', 'ap-south-1', 'ap-northeast-1', 'ap-northeast-2', 'ap-southeast-1', 'ap-southeast-2', 'ca-central-1', 'eu-central-1', 'eu-west-1', 'eu-west-2', 'eu-west-3', 'eu-north-1', 'me-south-1', 'sa-east-1'];
const REGIONS = ['us-east-2', 'us-east-1', 'us-west-2', 'ap-east-1', 'ap-south-1', 'ap-northeast-1', 'ap-northeast-2', 'ap-southeast-1', 'ap-southeast-2', 'ca-central-1', 'cn-north-1', 'cn-northwest-1', 'eu-central-1', 'eu-west-1', 'eu-west-2', 'eu-west-3', 'eu-north-1', 'me-south-1', 'sa-east-1'];
const RANCHER_GROUP = 'rancher-nodes';
// from https://docs.aws.amazon.com/eks/latest/userguide/kubernetes-versions.html
const VERSIONS = ['1.15', '1.14', '1.13']; // sort newest->oldest so we dont have to run any logic to sort like other provider versions
@ -429,6 +429,14 @@ export default Component.extend(ClusterDriver, {
},
listRoles(auth) {
// TODO There is no IAM endpoint in cn-northwest-1 region. We need to use cn-north-1 for now. So users chould be able to create EKS cluster in cn-northwest-1.
const { region } = auth || {};
if ( region === 'cn-northwest-1' ) {
auth.region = 'cn-north-1';
}
return new Promise((resolve, reject) => {
const IAM = new AWS.IAM(auth);