From c52c25c26f5ba9ed6ef2d74381dc7f9311a9028b Mon Sep 17 00:00:00 2001 From: loganhz Date: Wed, 14 Nov 2018 11:34:05 +0800 Subject: [PATCH] Fix editing aws node template issue https://github.com/rancher/rancher/issues/15607 --- lib/nodes/addon/components/driver-amazonec2/component.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/nodes/addon/components/driver-amazonec2/component.js b/lib/nodes/addon/components/driver-amazonec2/component.js index 4369182d0..19d52489e 100644 --- a/lib/nodes/addon/components/driver-amazonec2/component.js +++ b/lib/nodes/addon/components/driver-amazonec2/component.js @@ -307,7 +307,11 @@ export default Component.extend(NodeDriver, { }).sort().uniq(); if ( choices.length ) { - set(this, 'selectedZone', choices[0]); + if ( get(this, 'config.zone.length') ) { + set(this, 'selectedZone', `${ get(this, 'config.region') }${ get(this, 'config.zone') }`); + } else { + set(this, 'selectedZone', choices[0]); + } } return choices;