From a3cbbbd931489c10dd5987852e969f2c0db4d723 Mon Sep 17 00:00:00 2001 From: Michael Taufen Date: Mon, 9 Jul 2018 10:35:10 -0700 Subject: [PATCH] move call to defaultNodeStatusFuncs to after the rest of the Kubelet is constructed --- pkg/kubelet/kubelet.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pkg/kubelet/kubelet.go b/pkg/kubelet/kubelet.go index f57616aed2b..36edfe6cb93 100644 --- a/pkg/kubelet/kubelet.go +++ b/pkg/kubelet/kubelet.go @@ -789,7 +789,6 @@ func NewMainKubelet(kubeCfg *kubeletconfiginternal.KubeletConfiguration, klet.backOff = flowcontrol.NewBackOff(backOffPeriod, MaxContainerBackOff) klet.podKillingCh = make(chan *kubecontainer.PodPair, podKillingChannelCapacity) - klet.setNodeStatusFuncs = klet.defaultNodeStatusFuncs() // setup eviction manager evictionManager, evictionAdmitHandler := eviction.NewManager(klet.resourceAnalyzer, evictionConfig, killPodNow(klet.podWorkers, kubeDeps.Recorder), klet.imageManager, klet.containerGC, kubeDeps.Recorder, nodeRef, klet.clock) @@ -836,6 +835,11 @@ func NewMainKubelet(kubeCfg *kubeletconfiginternal.KubeletConfiguration, // Finally, put the most recent version of the config on the Kubelet, so // people can see how it was configured. klet.kubeletConfiguration = *kubeCfg + + // Generating the status funcs should be the last thing we do, + // since this relies on the rest of the Kubelet having been constructed. + klet.setNodeStatusFuncs = klet.defaultNodeStatusFuncs() + return klet, nil }