Merge pull request #3206 from loganhz/aks

Support China AKS
This commit is contained in:
Westly Wright 2019-08-08 09:22:14 -07:00 committed by GitHub
commit d7082a9f91
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 53 additions and 19 deletions

View File

@ -16,6 +16,8 @@ import {
} from 'ui/utils/azure-choices'; } from 'ui/utils/azure-choices';
const NETWORK_POLICY = ['Calico'] const NETWORK_POLICY = ['Calico']
const CHINA_REGION_API_URL = 'https://management.chinacloudapi.cn/';
const CHINA_REGION_AUTH_URL = 'https://login.chinacloudapi.cn/';
export default Component.extend(ClusterDriver, { export default Component.extend(ClusterDriver, {
globalStore: service(), globalStore: service(),
@ -80,6 +82,14 @@ export default Component.extend(ClusterDriver, {
tenantId: get(this, 'config.tenantId'), tenantId: get(this, 'config.tenantId'),
region: get(this, 'config.location') region: get(this, 'config.location')
}; };
if ( get(this, 'isChinaRegion') ) {
setProperties(data, {
baseUrl: CHINA_REGION_API_URL,
authBaseUrl: CHINA_REGION_AUTH_URL
})
}
const aksRequest = { const aksRequest = {
versions: store.rawRequest({ versions: store.rawRequest({
url: '/meta/aksVersions', url: '/meta/aksVersions',
@ -183,6 +193,10 @@ export default Component.extend(ClusterDriver, {
return ( get(this, 'mode') === 'edit' || get(this, 'mode') === 'new' ) ? true : false; return ( get(this, 'mode') === 'edit' || get(this, 'mode') === 'new' ) ? true : false;
}), }),
isChinaRegion: computed('config.location', function() {
return get(this, 'config.location').startsWith('china');
}),
saveDisabled: computed('config.subscriptionId', 'config.tenantId', 'config.clientId', 'config.clientSecret', 'config.location', function() { saveDisabled: computed('config.subscriptionId', 'config.tenantId', 'config.clientId', 'config.clientSecret', 'config.location', function() {
return get(this, 'config.tenantId') && get(this, 'config.clientId') && get(this, 'config.clientSecret') && get(this, 'config.subscriptionId') && get(this, 'config.location') ? false : true; return get(this, 'config.tenantId') && get(this, 'config.clientId') && get(this, 'config.clientSecret') && get(this, 'config.subscriptionId') && get(this, 'config.location') ? false : true;
}), }),
@ -295,6 +309,16 @@ export default Component.extend(ClusterDriver, {
}) })
} }
if ( get(this, 'isChinaRegion') ) {
setProperties(config, {
baseUrl: CHINA_REGION_API_URL,
authBaseUrl: CHINA_REGION_AUTH_URL
})
} else {
delete config['baseUrl'];
delete config['authBaseUrl'];
}
return this._super(...arguments); return this._super(...arguments);
}, },
}); });

View File

@ -163,6 +163,7 @@
</div> </div>
<div class="row"> <div class="row">
{{#unless isChinaRegion}}
<div class="col span-6"> <div class="col span-6">
<label class="acc-label"> <label class="acc-label">
{{t "clusterNew.azureaks.enableHttpApplicationRouting.label"}} {{t "clusterNew.azureaks.enableHttpApplicationRouting.label"}}
@ -184,6 +185,7 @@
</label> </label>
</div> </div>
</div> </div>
{{/unless}}
<div class="col span-6"> <div class="col span-6">
<label class="acc-label"> <label class="acc-label">
{{t "clusterNew.azureaks.enableMonitoring.label"}} {{t "clusterNew.azureaks.enableMonitoring.label"}}

View File

@ -449,6 +449,14 @@ export let aksRegions = [
'name': 'centralus', 'name': 'centralus',
'displayName': 'Central US', 'displayName': 'Central US',
}, },
{
'name': 'chinanorth2',
'displayName': 'China North 2',
},
{
'name': 'chinaeast2',
'displayName': 'China East 2',
},
{ {
'name': 'eastasia', 'name': 'eastasia',
'displayName': 'East Asia', 'displayName': 'East Asia',