Skip to content

Commit

Permalink
Generate join command based on selected node type when adding a node (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
sgalsaleh authored Nov 29, 2023
1 parent dd0b7e3 commit d76ba5e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
4 changes: 4 additions & 0 deletions pkg/kurl/configmap.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,10 @@ func UpdateConfigMap(client kubernetes.Interface, generateBootstrapToken, upload
return nil, errors.Wrap(err, "get configmap")
}

if cm.Data == nil {
cm.Data = map[string]string{}
}

// To be backwards compatible with kotsadm 1.1.0 and 1.2.0, if neither the bootstrap token nor
// the upload certs flags are set then generate a token for a worker node
if !uploadCerts {
Expand Down
6 changes: 5 additions & 1 deletion web/src/components/apps/KurlClusterManagement.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,11 @@ export class KurlClusterManagement extends Component {
displayAddNode: true,
},
async () => {
await this.generateWorkerAddNodeCommand();
if (this.state.selectedNodeType === "secondary") {
await this.generateWorkerAddNodeCommand();
} else {
await this.generatePrimaryAddNodeCommand();
}
}
);
};
Expand Down

0 comments on commit d76ba5e

Please sign in to comment.