Skip to content

Commit

Permalink
Fix panics when joining worker nodes without an initConfiguration (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
neoaggelos authored Nov 30, 2022
1 parent 2e865a6 commit 7b08d3e
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions controllers/microk8sconfig_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -480,14 +480,15 @@ func (r *MicroK8sConfigReconciler) handleJoiningWorkerNode(ctx context.Context,
KubernetesVersion: *machine.Spec.Version,
ClusterAgentPort: portOfNodeToConnectTo,
JoinNodeIP: ipOfNodeToConnectTo,
ExtraWriteFiles: cloudinit.WriteFilesFromAPI(microk8sConfig.Spec.InitConfiguration.ExtraWriteFiles),
ExtraKubeletArgs: microk8sConfig.Spec.InitConfiguration.ExtraKubeletArgs,
}

if c := microk8sConfig.Spec.InitConfiguration; c != nil {
workerInput.ContainerdHTTPSProxy = c.HTTPSProxy
workerInput.ContainerdHTTPProxy = c.HTTPProxy
workerInput.ContainerdNoProxy = c.NoProxy

workerInput.ExtraKubeletArgs = c.ExtraKubeletArgs
workerInput.ExtraWriteFiles = cloudinit.WriteFilesFromAPI(c.ExtraWriteFiles)
}
bootstrapInitData, err := cloudinit.NewJoinWorker(workerInput)
if err != nil {
Expand Down

0 comments on commit 7b08d3e

Please sign in to comment.