diff --git a/pkg/controller/init.go b/pkg/controller/init.go index 7c057ff29e0..08c826827fe 100644 --- a/pkg/controller/init.go +++ b/pkg/controller/init.go @@ -583,6 +583,10 @@ func (c *Controller) initNodeRoutes() error { } func (c *Controller) initAppendPodExternalIds(pod *v1.Pod) error { + if !isPodAlive(pod) { + return nil + } + podNets, err := c.getPodKubeovnNets(pod) if err != nil { klog.Errorf("failed to get pod nets %v", err) diff --git a/pkg/controller/node.go b/pkg/controller/node.go index 91bae883721..56f7ee3b7e5 100644 --- a/pkg/controller/node.go +++ b/pkg/controller/node.go @@ -733,7 +733,7 @@ func (c *Controller) fetchPodsOnNode(nodeName string) ([]string, error) { ports := make([]string, 0, len(pods)) for _, pod := range pods { - if !isPodAlive(pod) || pod.Spec.HostNetwork || pod.Spec.NodeName != nodeName { + if !isPodAlive(pod) || pod.Spec.HostNetwork || pod.Spec.NodeName != nodeName || pod.Annotations[util.LogicalRouterAnnotation] != util.DefaultVpc { continue }