From 049cab2c114f3fdca4b0b4b18fcd1a3515c2d855 Mon Sep 17 00:00:00 2001 From: Yan Zhu Date: Wed, 10 Apr 2019 12:21:01 +0800 Subject: [PATCH] fix pod has no ip --- pkg/controller/pod.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/controller/pod.go b/pkg/controller/pod.go index 98e46b012a8..53c372a0443 100644 --- a/pkg/controller/pod.go +++ b/pkg/controller/pod.go @@ -43,8 +43,8 @@ func (c *Controller) enqueueDeletePod(obj interface{}) { func (c *Controller) enqueueUpdatePod(oldObj, newObj interface{}) { oldPod := oldObj.(*v1.Pod) newPod := newObj.(*v1.Pod) - // assigned to a node - if oldPod.Spec.NodeName == "" && newPod.Spec.NodeName != "" { + // pod assigned an ip + if oldPod.Status.PodIP == "" && newPod.Status.PodIP != "" { var key string var err error if key, err = cache.MetaNamespaceKeyFunc(newObj); err != nil {