@@ -173,6 +173,13 @@ func (c *Controller) handleUpdateNp(key string) error {
173173 }
174174
175175 if hasIngressRule (np ) {
176+ blockACLOps , err := c .OVNNbClient .UpdateDefaultBlockACLOps (npName , pgName , ovnnb .ACLDirectionToLport , logEnable )
177+ if err != nil {
178+ klog .Errorf ("failed to set default ingress block acl: %v" , err )
179+ return fmt .Errorf ("failed to set default ingress block acl: %w" , err )
180+ }
181+ ingressACLOps = append (ingressACLOps , blockACLOps ... )
182+
176183 for _ , protocol := range protocolSet .List () {
177184 for idx , npr := range np .Spec .Ingress {
178185 // A single address set must contain addresses of the same type and the name must be unique within table, so IPv4 and IPv6 address set should be different
@@ -214,7 +221,7 @@ func (c *Controller) handleUpdateNp(key string) error {
214221 npp = npr .Ports
215222 }
216223
217- ops , err := c .OVNNbClient .UpdateIngressACLOps (key , pgName , ingressAllowAsName , ingressExceptAsName , protocol , aclName , npp , logEnable , logActions , namedPortMap )
224+ ops , err := c .OVNNbClient .UpdateIngressACLOps (pgName , ingressAllowAsName , ingressExceptAsName , protocol , aclName , npp , logEnable , logActions , namedPortMap )
218225 if err != nil {
219226 klog .Errorf ("generate operations that add ingress acls to np %s: %v" , key , err )
220227 return err
@@ -236,7 +243,7 @@ func (c *Controller) handleUpdateNp(key string) error {
236243 return err
237244 }
238245
239- ops , err := c .OVNNbClient .UpdateIngressACLOps (key , pgName , ingressAllowAsName , ingressExceptAsName , protocol , aclName , nil , logEnable , logActions , namedPortMap )
246+ ops , err := c .OVNNbClient .UpdateIngressACLOps (pgName , ingressAllowAsName , ingressExceptAsName , protocol , aclName , nil , logEnable , logActions , namedPortMap )
240247 if err != nil {
241248 klog .Errorf ("generate operations that add ingress acls to np %s: %v" , key , err )
242249 return err
@@ -302,6 +309,13 @@ func (c *Controller) handleUpdateNp(key string) error {
302309 }
303310
304311 if hasEgressRule (np ) {
312+ blockACLOps , err := c .OVNNbClient .UpdateDefaultBlockACLOps (npName , pgName , ovnnb .ACLDirectionFromLport , logEnable )
313+ if err != nil {
314+ klog .Errorf ("failed to set default egress block acl: %v" , err )
315+ return fmt .Errorf ("failed to set default egress block acl: %w" , err )
316+ }
317+ egressACLOps = append (egressACLOps , blockACLOps ... )
318+
305319 for _ , protocol := range protocolSet .List () {
306320 for idx , npr := range np .Spec .Egress {
307321 // A single address set must contain addresses of the same type and the name must be unique within table, so IPv4 and IPv6 address set should be different
@@ -343,7 +357,7 @@ func (c *Controller) handleUpdateNp(key string) error {
343357 npp = npr .Ports
344358 }
345359
346- ops , err := c .OVNNbClient .UpdateEgressACLOps (key , pgName , egressAllowAsName , egressExceptAsName , protocol , aclName , npp , logEnable , logActions , namedPortMap )
360+ ops , err := c .OVNNbClient .UpdateEgressACLOps (pgName , egressAllowAsName , egressExceptAsName , protocol , aclName , npp , logEnable , logActions , namedPortMap )
347361 if err != nil {
348362 klog .Errorf ("generate operations that add egress acls to np %s: %v" , key , err )
349363 return err
@@ -365,7 +379,7 @@ func (c *Controller) handleUpdateNp(key string) error {
365379 return err
366380 }
367381
368- ops , err := c .OVNNbClient .UpdateEgressACLOps (key , pgName , egressAllowAsName , egressExceptAsName , protocol , aclName , nil , logEnable , logActions , namedPortMap )
382+ ops , err := c .OVNNbClient .UpdateEgressACLOps (pgName , egressAllowAsName , egressExceptAsName , protocol , aclName , nil , logEnable , logActions , namedPortMap )
369383 if err != nil {
370384 klog .Errorf ("generate operations that add egress acls to np %s: %v" , key , err )
371385 return err
0 commit comments