From eb3647176ddbed8f61aedb688d6d2c4800e60446 Mon Sep 17 00:00:00 2001 From: hzma Date: Mon, 6 Dec 2021 15:36:27 +0800 Subject: [PATCH] add pod in default vpc to node port-group --- pkg/controller/init.go | 4 ++++ pkg/controller/node.go | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) 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 }