mirror of https://github.com/rancher/ui.git
Merge pull request #4700 from codyrancher/gke-versions-region
Making use of region instead of zone while querying meta/gkeVersion when available
This commit is contained in:
commit
ea36d73a76
|
|
@ -229,7 +229,7 @@ export default Component.extend(ClusterDriver, {
|
|||
set(this, 'config.projectId', this.google.parseProjectId(get(this, 'config')));
|
||||
}),
|
||||
|
||||
zoneChanged: observer('config.zone', 'zones.[]', function() {
|
||||
zoneChanged: observer('config.zone', 'zones.[]', 'locationType', 'config.region', function() {
|
||||
if (this.saving) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -540,13 +540,17 @@ export default Component.extend(ClusterDriver, {
|
|||
return;
|
||||
}
|
||||
|
||||
const region = get(this, 'config.region');
|
||||
const zone = region ? undefined : get(this, 'config.zone');
|
||||
|
||||
return get(this, 'globalStore').rawRequest({
|
||||
url: '/meta/gkeVersions',
|
||||
method: 'POST',
|
||||
data: {
|
||||
credentials: get(this, 'config.credential'),
|
||||
projectId: get(this, 'config.projectId'),
|
||||
zone: get(this, 'config.zone') || `${ get(this, 'config.region') }-b`,
|
||||
zone,
|
||||
region
|
||||
}
|
||||
}).then((xhr) => {
|
||||
const out = xhr.body;
|
||||
|
|
|
|||
|
|
@ -348,12 +348,11 @@ export default Service.extend({
|
|||
}
|
||||
const config = get(cluster, 'gkeConfig');
|
||||
|
||||
const zone = get(config, 'zone') || `${ get(config, 'region') }-b`;
|
||||
const neuConfig = { ...config };
|
||||
|
||||
delete neuConfig.region;
|
||||
|
||||
set(neuConfig, 'zone', zone);
|
||||
if (config.region && neuConfig.zone) {
|
||||
delete neuConfig.zone;
|
||||
}
|
||||
|
||||
const neuURL = this.parseRequestData('/meta/gkeVersions', neuConfig, cluster?.id);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue