Skip to content

Commit

Permalink
netpol: fix packet drop casued by incorrect address set deletion
Browse files Browse the repository at this point in the history
  • Loading branch information
zhangzujian committed Apr 19, 2023
1 parent 9c5523f commit 7ca8b88
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions pkg/controller/network_policy.go
Original file line number Diff line number Diff line change
Expand Up @@ -238,18 +238,6 @@ func (c *Controller) handleUpdateNp(key string) error {
}
}

ingressAsNames, err := c.ovnLegacyClient.ListNpAddressSet(np.Namespace, npName, "ingress")
if err != nil {
klog.Errorf("failed to list ingress address_set, %v", err)
return err
}
for _, ingressAsName := range ingressAsNames {
if err = c.ovnLegacyClient.DeleteAddressSet(ingressAsName); err != nil {
klog.Errorf("failed to delete np %s address set, %v", key, err)
return err
}
}

var ingressAclCmd []string
exist, err := c.ovnClient.PortGroupExists(pgName)
if err != nil {
Expand Down Expand Up @@ -381,18 +369,6 @@ func (c *Controller) handleUpdateNp(key string) error {
}
}

egressAsNames, err := c.ovnLegacyClient.ListNpAddressSet(np.Namespace, npName, "egress")
if err != nil {
klog.Errorf("failed to list egress address_set, %v", err)
return err
}
for _, egressAsName := range egressAsNames {
if err = c.ovnLegacyClient.DeleteAddressSet(egressAsName); err != nil {
klog.Errorf("failed to delete np %s address set, %v", key, err)
return err
}
}

var egressAclCmd []string
if exist, err = c.ovnClient.PortGroupExists(pgName); err != nil {
klog.Errorf("failed to query np %s port group, %v", key, err)
Expand Down

0 comments on commit 7ca8b88

Please sign in to comment.