eks v2 set nodeGroup version number on create

rancher/rancher#28604
This commit is contained in:
Westly Wright 2020-08-28 13:54:37 -07:00
parent dda996a2cf
commit 1d8f3f3ef9
No known key found for this signature in database
GPG Key ID: 4FAB3D8673DC54A3
1 changed files with 14 additions and 4 deletions

View File

@ -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);
},