From 6c04b615f47dc744cbfad511176d63183e2d7598 Mon Sep 17 00:00:00 2001 From: Antonio Murdaca Date: Mon, 18 Mar 2019 10:25:08 +0100 Subject: [PATCH] pkg/daemon: fix oncefrom panic we were panicking in onceFrom since the dn.queue isn't initialized in onceFrom. Signed-off-by: Antonio Murdaca --- pkg/daemon/daemon.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/daemon/daemon.go b/pkg/daemon/daemon.go index 5631d5d677..2dd8e3beb3 100644 --- a/pkg/daemon/daemon.go +++ b/pkg/daemon/daemon.go @@ -433,9 +433,6 @@ func (dn *Daemon) detectEarlySSHAccessesFromBoot() error { // responsible for triggering callbacks to handle updates. Successful // updates shouldn't return, and should just reboot the node. func (dn *Daemon) Run(stopCh <-chan struct{}, exitCh <-chan error) error { - defer utilruntime.HandleCrash() - defer dn.queue.ShutDown() - if dn.kubeletHealthzEnabled { glog.Info("Enabling Kubelet Healthz Monitor") go dn.runKubeletHealthzMonitor(stopCh, dn.exitCh) @@ -461,6 +458,9 @@ func (dn *Daemon) Run(stopCh <-chan struct{}, exitCh <-chan error) error { } } + defer utilruntime.HandleCrash() + defer dn.queue.ShutDown() + if !cache.WaitForCacheSync(stopCh, dn.nodeListerSynced, dn.mcListerSynced) { return errors.New("failed to sync initial listers cache") }