From 8058cee2c9b8e131cebcd1d898146c864059ba17 Mon Sep 17 00:00:00 2001 From: GLYASAI Date: Fri, 14 Feb 2020 11:31:22 +0800 Subject: [PATCH] fix 'runtime.Object is nil' --- discover.v2/k8s_discover.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/discover.v2/k8s_discover.go b/discover.v2/k8s_discover.go index a1bcc9000..ac8fcc424 100644 --- a/discover.v2/k8s_discover.go +++ b/discover.v2/k8s_discover.go @@ -84,6 +84,9 @@ func (k *k8sDiscover) discover(name string, callback CallbackUpdate) { case <-ctx.Done(): return case event := <-w.ResultChan(): + if event.Object == nil { + continue + } pod := event.Object.(*corev1.Pod) ep := endpointForPod(pod) switch event.Type {