From 076b19f0eb531c548b8970a1c182c840f28faaed Mon Sep 17 00:00:00 2001 From: "Lubomir I. Ivanov" Date: Tue, 4 Jan 2022 21:28:13 +0200 Subject: [PATCH] kubeadm: fix panic in runKubeletConfigPhase The "nro" struct must be initialized before passing it to GetNodeRegistration(). --- cmd/kubeadm/app/cmd/phases/upgrade/node/kubeletconfig.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmd/kubeadm/app/cmd/phases/upgrade/node/kubeletconfig.go b/cmd/kubeadm/app/cmd/phases/upgrade/node/kubeletconfig.go index a31e2c55173..430fa2a03d2 100644 --- a/cmd/kubeadm/app/cmd/phases/upgrade/node/kubeletconfig.go +++ b/cmd/kubeadm/app/cmd/phases/upgrade/node/kubeletconfig.go @@ -102,8 +102,8 @@ func runKubeletConfigPhase() func(c workflow.RunData) error { // // TODO: this workaround can be removed in 1.25 once all user node sockets have a URL scheme: // https://github.com/kubernetes/kubeadm/issues/2426 - var nro *kubeadmapi.NodeRegistrationOptions var missingURLScheme bool + nro := &kubeadmapi.NodeRegistrationOptions{} if !dryRun { if err := configutil.GetNodeRegistration(data.KubeConfigPath(), data.Client(), nro); err != nil { return errors.Wrap(err, "could not retrieve the node registration options for this node")