Skip to content

Commit

Permalink
fix: do not add unallocated pod to port-group
Browse files Browse the repository at this point in the history
E1216 06:32:23.551067       1 network_policy.go:99] error syncing 'src/default-deny-all': ovn-nbctl: perf-gp989.src: port name not found
  • Loading branch information
oilbeater committed Dec 16, 2019
1 parent d5ed1ee commit ca5539f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion pkg/controller/network_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package controller

import (
"fmt"
"github.com/alauda/kube-ovn/pkg/util"
"reflect"
"strings"

Expand Down Expand Up @@ -389,7 +390,7 @@ func (c *Controller) fetchSelectedPorts(namespace string, selector *metav1.Label

ports := make([]string, 0, len(pods))
for _, pod := range pods {
if !pod.Spec.HostNetwork {
if !pod.Spec.HostNetwork && pod.Annotations[util.AllocatedAnnotation] == "true" {
ports = append(ports, fmt.Sprintf("%s.%s", pod.Name, pod.Namespace))
}
}
Expand Down

0 comments on commit ca5539f

Please sign in to comment.