Skip to content

Commit

Permalink
add pod in default vpc to node port-group
Browse files Browse the repository at this point in the history
  • Loading branch information
hongzhen-ma committed Dec 6, 2021
1 parent 90f62fd commit eb36471
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
4 changes: 4 additions & 0 deletions pkg/controller/init.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion pkg/controller/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down

0 comments on commit eb36471

Please sign in to comment.