From 01b07bdd9a42e89bbb96d61a323bdcbdc63538d0 Mon Sep 17 00:00:00 2001 From: Vincent Fiduccia Date: Fri, 30 Aug 2019 17:49:12 -0700 Subject: [PATCH] Fix azure required fields, rke templates option location --- app/components/input-edit-password/component.js | 2 +- app/instance-initializers/nav.js | 16 +++++++--------- .../cluster-driver/driver-rke/component.js | 2 +- .../components/cru-cloud-provider/component.js | 8 ++++++++ .../components/cru-cluster-template/template.hbs | 7 ------- .../addon/components/cru-node-pools/component.js | 2 +- 6 files changed, 18 insertions(+), 19 deletions(-) diff --git a/app/components/input-edit-password/component.js b/app/components/input-edit-password/component.js index 3c69cc2d3..cd3df6037 100644 --- a/app/components/input-edit-password/component.js +++ b/app/components/input-edit-password/component.js @@ -83,7 +83,7 @@ export default Component.extend({ } }); - return all(promises); + return all(promises).catch(() => resolve()); }); } else { return resolve(); diff --git a/app/instance-initializers/nav.js b/app/instance-initializers/nav.js index 76a3f07dc..be6601b70 100644 --- a/app/instance-initializers/nav.js +++ b/app/instance-initializers/nav.js @@ -295,15 +295,6 @@ const rootNav = [ route: 'global-admin.clusters', resource: ['cluster'], resourceScope: 'global', - submenu: [ - { - id: 'rke-template', - localizedLabel: 'nav.admin.clusters.rkeTemplate', - route: 'global-admin.cluster-templates', - resource: ['clustertemplate'], - resourceScope: 'global', - }, - ], }, { scope: 'global', @@ -402,6 +393,13 @@ const rootNav = [ // resource: ['globaldns'], // resourceScope: 'global', // }, + { + id: 'rke-template', + localizedLabel: 'nav.admin.clusters.rkeTemplate', + route: 'global-admin.cluster-templates', + resource: ['clustertemplate'], + resourceScope: 'global', + }, ], }, // { diff --git a/lib/shared/addon/components/cluster-driver/driver-rke/component.js b/lib/shared/addon/components/cluster-driver/driver-rke/component.js index 546c3f92d..47fc65ebc 100644 --- a/lib/shared/addon/components/cluster-driver/driver-rke/component.js +++ b/lib/shared/addon/components/cluster-driver/driver-rke/component.js @@ -979,7 +979,7 @@ export default InputTextFile.extend(ManageLabels, ClusterDriver, { const azureProvider = get(revision, 'clusterConfig.rancherKubernetesEngineConfig.cloudProvider.azureCloudProvider') || {}; if ( cloudProvider === 'azure' ) { - const azureQuestions = (get(revision, 'nuestions') || []).map((x) => x.variable.replace(/^rancherKubernetesEngineConfig\.cloudProvider\.azureCloudProvider\./, '')); + const azureQuestions = (get(revision, 'questions') || []).map((x) => x.variable.replace(/^rancherKubernetesEngineConfig\.cloudProvider\.azureCloudProvider\./, '')); const requiredFields = Object.keys(AzureInfo).filter((k) => AzureInfo[k].required); requiredFields.forEach((key) => { diff --git a/lib/shared/addon/components/cru-cloud-provider/component.js b/lib/shared/addon/components/cru-cloud-provider/component.js index a11153002..a7c4079aa 100644 --- a/lib/shared/addon/components/cru-cloud-provider/component.js +++ b/lib/shared/addon/components/cru-cloud-provider/component.js @@ -129,6 +129,10 @@ export default Component.extend({ } else { if (this.configName) { next(() => { + if ( this.destroyed || this.destroying) { + return; + } + set(this, 'selectedCloudProvider', this.configName); }); } @@ -136,6 +140,10 @@ export default Component.extend({ } else { if (!this.configName) { next(() => { + if ( this.destroyed || this.destroying) { + return; + } + set(this, 'selectedCloudProvider', this.selectedCloudProvider === 'generic' ? 'generic' : 'none'); }); } diff --git a/lib/shared/addon/components/cru-cluster-template/template.hbs b/lib/shared/addon/components/cru-cluster-template/template.hbs index 3655bfe31..371043d34 100644 --- a/lib/shared/addon/components/cru-cluster-template/template.hbs +++ b/lib/shared/addon/components/cru-cluster-template/template.hbs @@ -1,10 +1,3 @@ - -
{ const templateId = get(pool, 'nodeTemplateId'); - if ( !templates.findBy('id', templateId) ) { + if ( templateId && !templates.findBy('id', templateId) ) { templates.push(get(this, 'globalStore').createRecord({ type: 'nodetemplate', id: templateId,