From 7b08d3eae12ffc4bd13fa84631a15f811f8c6ae0 Mon Sep 17 00:00:00 2001 From: Angelos Kolaitis Date: Wed, 30 Nov 2022 23:41:56 +0200 Subject: [PATCH] Fix panics when joining worker nodes without an initConfiguration (#54) --- controllers/microk8sconfig_controller.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/controllers/microk8sconfig_controller.go b/controllers/microk8sconfig_controller.go index 6610376..fbc3e61 100644 --- a/controllers/microk8sconfig_controller.go +++ b/controllers/microk8sconfig_controller.go @@ -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 {