mirror of https://github.com/rancher/ui.git
parent
dda996a2cf
commit
1d8f3f3ef9
|
|
@ -78,13 +78,18 @@ export default Component.extend(ClusterDriver, {
|
|||
let config = get(this, 'cluster.eksConfig');
|
||||
|
||||
if ( !config ) {
|
||||
const ngConfig = DEFAULT_NODE_GROUP_CONFIG;
|
||||
const kubernetesVersion = this.kubernetesVersionContent.firstObject;
|
||||
|
||||
set(ngConfig, 'version', kubernetesVersion);
|
||||
|
||||
config = this.globalStore.createRecord({
|
||||
kubernetesVersion: this.kubernetesVersionContent.firstObject,
|
||||
kubernetesVersion,
|
||||
privateAccess: false,
|
||||
publicAccess: true,
|
||||
region: 'us-west-2',
|
||||
type: 'eksclusterconfigspec',
|
||||
nodeGroups: [this.globalStore.createRecord(DEFAULT_NODE_GROUP_CONFIG)],
|
||||
nodeGroups: [this.globalStore.createRecord(ngConfig)],
|
||||
kmsKey: ''
|
||||
});
|
||||
|
||||
|
|
@ -124,13 +129,18 @@ export default Component.extend(ClusterDriver, {
|
|||
|
||||
actions: {
|
||||
addNodeGroup() {
|
||||
let { config: { nodeGroups = [] } } = this;
|
||||
let { config } = this;
|
||||
let { nodeGroups = [], kubernetesVersion } = config;
|
||||
|
||||
if (!isArray(nodeGroups)) {
|
||||
nodeGroups = [];
|
||||
}
|
||||
|
||||
nodeGroups.pushObject(this.globalStore.createRecord(DEFAULT_NODE_GROUP_CONFIG));
|
||||
const nodeGroup = this.globalStore.createRecord(DEFAULT_NODE_GROUP_CONFIG);
|
||||
|
||||
set(nodeGroup, 'version', kubernetesVersion);
|
||||
|
||||
nodeGroups.pushObject(nodeGroup);
|
||||
|
||||
set(this, 'config.nodeGroups', nodeGroups);
|
||||
},
|
||||
|
|
|
|||
Loading…
Reference in New Issue