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')));
|
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) {
|
if (this.saving) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
@ -540,13 +540,17 @@ export default Component.extend(ClusterDriver, {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const region = get(this, 'config.region');
|
||||||
|
const zone = region ? undefined : get(this, 'config.zone');
|
||||||
|
|
||||||
return get(this, 'globalStore').rawRequest({
|
return get(this, 'globalStore').rawRequest({
|
||||||
url: '/meta/gkeVersions',
|
url: '/meta/gkeVersions',
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
data: {
|
data: {
|
||||||
credentials: get(this, 'config.credential'),
|
credentials: get(this, 'config.credential'),
|
||||||
projectId: get(this, 'config.projectId'),
|
projectId: get(this, 'config.projectId'),
|
||||||
zone: get(this, 'config.zone') || `${ get(this, 'config.region') }-b`,
|
zone,
|
||||||
|
region
|
||||||
}
|
}
|
||||||
}).then((xhr) => {
|
}).then((xhr) => {
|
||||||
const out = xhr.body;
|
const out = xhr.body;
|
||||||
|
|
|
||||||
|
|
@ -348,12 +348,11 @@ export default Service.extend({
|
||||||
}
|
}
|
||||||
const config = get(cluster, 'gkeConfig');
|
const config = get(cluster, 'gkeConfig');
|
||||||
|
|
||||||
const zone = get(config, 'zone') || `${ get(config, 'region') }-b`;
|
|
||||||
const neuConfig = { ...config };
|
const neuConfig = { ...config };
|
||||||
|
|
||||||
delete neuConfig.region;
|
if (config.region && neuConfig.zone) {
|
||||||
|
delete neuConfig.zone;
|
||||||
set(neuConfig, 'zone', zone);
|
}
|
||||||
|
|
||||||
const neuURL = this.parseRequestData('/meta/gkeVersions', neuConfig, cluster?.id);
|
const neuURL = this.parseRequestData('/meta/gkeVersions', neuConfig, cluster?.id);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue