Skip to content

Commit 830f317

Browse files
committed
Revert "update agent.md"
This reverts commit a7e591f.
1 parent a7e591f commit 830f317

File tree

3 files changed

+18
-29
lines changed

3 files changed

+18
-29
lines changed

AGENTS.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,9 @@
1111
- `make lint` – run `golangci-lint` plus Go “modernize”; auto-fixes when not in CI.
1212
- `make ut` – run unit tests: Ginkgo suites in `test/unittest` and `go test` with coverage for `pkg`.
1313

14-
## General Coding Style
15-
- Every time after editing code. MUST run `make lint` to detect and fix potential lint issues.
16-
- When modifying code, try to clean up any related code logic that is no longer needed.
14+
## Coding Style & Naming Conventions
1715
- Follow `CODE_STYLE.md`: camelCase identifiers, keep functions short (~100 lines), return/log errors instead of discarding, and prefer `if err := ...; err != nil` patterns.
16+
- Run `make lint` to detect and fix potential lint issues.
1817

1918
## Adding a New Feature
2019
- Plan first: clarify any uncertainties and confirm the approach before making changes.

pkg/ovs/ovn-nb-acl.go

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -328,19 +328,13 @@ func (c *OVNNbClient) CreateGatewayACL(lsName, pgName, gateway, u2oInterconnecti
328328
}
329329

330330
if v6Exists {
331-
icmpv6EgressACL, err := c.newACL(parentName, ovnnb.ACLDirectionFromLport, util.EgressAllowPriority, "icmp6", ovnnb.ACLActionAllowStateless, util.NetpolACLTier, options)
331+
ndACL, err := c.newACL(parentName, ovnnb.ACLDirectionFromLport, util.EgressAllowPriority, "nd || nd_ra || nd_rs", ovnnb.ACLActionAllowStateless, util.NetpolACLTier, options)
332332
if err != nil {
333333
klog.Error(err)
334-
return fmt.Errorf("new icmpv6 egress acl for %s: %w", parentName, err)
334+
return fmt.Errorf("new nd acl for %s: %w", parentName, err)
335335
}
336336

337-
icmpv6IngressACL, err := c.newACL(parentName, ovnnb.ACLDirectionToLport, util.IngressAllowPriority, "icmp6", ovnnb.ACLActionAllowStateless, util.NetpolACLTier)
338-
if err != nil {
339-
klog.Error(err)
340-
return fmt.Errorf("new icmpv6 ingress acl for %s: %w", parentName, err)
341-
}
342-
343-
acls = append(acls, icmpv6EgressACL, icmpv6IngressACL)
337+
acls = append(acls, ndACL)
344338
}
345339

346340
if err := c.CreateAcls(parentName, parentType, acls...); err != nil {

pkg/ovs/ovn-nb-acl_test.go

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -503,15 +503,14 @@ func (suite *OvnClientTestSuite) testCreateGatewayACL() {
503503
checkACL(parent, ovnnb.ACLDirectionFromLport, util.EgressAllowPriority, match, map[string]string{
504504
"apply-after-lb": "true",
505505
})
506-
}
507-
}
508506

509-
expectICMPv6 := func(parent any) {
510-
match := "icmp6"
511-
checkACL(parent, ovnnb.ACLDirectionFromLport, util.EgressAllowPriority, match, map[string]string{
512-
"apply-after-lb": "true",
513-
})
514-
checkACL(parent, ovnnb.ACLDirectionToLport, util.IngressAllowPriority, match, nil)
507+
if ipSuffix == "ip6" {
508+
match = "nd || nd_ra || nd_rs"
509+
checkACL(parent, ovnnb.ACLDirectionFromLport, util.EgressAllowPriority, match, map[string]string{
510+
"apply-after-lb": "true",
511+
})
512+
}
513+
}
515514
}
516515

517516
t.Run("add acl to pg", func(t *testing.T) {
@@ -531,10 +530,9 @@ func (suite *OvnClientTestSuite) testCreateGatewayACL() {
531530

532531
pg, err := nbClient.GetPortGroup(pgName, false)
533532
require.NoError(t, err)
534-
require.Len(t, pg.ACLs, 6)
533+
require.Len(t, pg.ACLs, 5)
535534

536535
expect(pg, gateway)
537-
expectICMPv6(pg)
538536
})
539537

540538
t.Run("gateway's protocol is dual with u2oInterconnectionIP", func(t *testing.T) {
@@ -552,7 +550,7 @@ func (suite *OvnClientTestSuite) testCreateGatewayACL() {
552550

553551
pg, err := nbClient.GetPortGroup(pgName, false)
554552
require.NoError(t, err)
555-
require.Len(t, pg.ACLs, 10)
553+
require.Len(t, pg.ACLs, 9)
556554

557555
expect(pg, gateway)
558556
expect(pg, u2oInterconnectionIP)
@@ -612,12 +610,12 @@ func (suite *OvnClientTestSuite) testCreateGatewayACL() {
612610

613611
pg, err := nbClient.GetPortGroup(pgName, false)
614612
require.NoError(t, err)
615-
require.Len(t, pg.ACLs, 4)
613+
require.Len(t, pg.ACLs, 3)
616614

617615
expect(pg, gateway)
618616
})
619617

620-
t.Run("gateway's protocol is ipv6 with u2oInterconnectionIP", func(t *testing.T) {
618+
t.Run("gateway's protocol is ipv6", func(t *testing.T) {
621619
t.Parallel()
622620

623621
pgName := "test_create_gw_acl_pg_v6_u2oInterconnectionIP"
@@ -632,11 +630,10 @@ func (suite *OvnClientTestSuite) testCreateGatewayACL() {
632630

633631
pg, err := nbClient.GetPortGroup(pgName, false)
634632
require.NoError(t, err)
635-
require.Len(t, pg.ACLs, 6)
633+
require.Len(t, pg.ACLs, 5)
636634

637635
expect(pg, gateway)
638636
expect(pg, u2oInterconnectionIP)
639-
expectICMPv6(pg)
640637
})
641638
})
642639

@@ -657,10 +654,9 @@ func (suite *OvnClientTestSuite) testCreateGatewayACL() {
657654

658655
ls, err := nbClient.GetLogicalSwitch(lsName, false)
659656
require.NoError(t, err)
660-
require.Len(t, ls.ACLs, 6)
657+
require.Len(t, ls.ACLs, 5)
661658

662659
expect(ls, gateway)
663-
expectICMPv6(ls)
664660
})
665661
})
666662

0 commit comments

Comments
 (0)