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 7, 2021
1 parent e1dfa7b commit b96b705
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 @@ -528,6 +528,10 @@ func (c *Controller) initSyncCrdVlans() 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 @@ -682,7 +682,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 b96b705

Please sign in to comment.