From 4ac78a456cb2abe3a407e015c6f7145d9ea85af2 Mon Sep 17 00:00:00 2001 From: Marco Supino Date: Wed, 18 Mar 2026 09:59:30 +0200 Subject: [PATCH 1/3] Fix DriveNets default node services and interface count - Fix SSH service inside port to match outside port (22 instead of 9339) - Add gNMI service on port 51337 - Add gNMI-SSL service on port 52443 - Fix interface count off-by-one (add +1 for management interface) Made-with: Cursor --- topo/node/drivenets/drivenets.go | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/topo/node/drivenets/drivenets.go b/topo/node/drivenets/drivenets.go index 56fb895a..240b2a22 100644 --- a/topo/node/drivenets/drivenets.go +++ b/topo/node/drivenets/drivenets.go @@ -57,16 +57,24 @@ var ( // https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml?search=gnmi 22: { Names: []string{"ssh"}, - Inside: 9339, + Inside: 22, }, 830: { Names: []string{"netconf"}, Inside: 830, }, 50051: { - Names: []string{"gnmi"}, + Names: []string{"grpc"}, Inside: 50051, }, + 51337: { + Names: []string{"gnmi"}, + Inside: 51337, + }, + 52443: { + Names: []string{"gnmi-ssl"}, + Inside: 52443, + }, }, Config: &tpb.Config{ ConfigFile: "default", @@ -171,7 +179,7 @@ func (n *Node) cdnosCreate(ctx context.Context) error { ConfigFile: config.ConfigFile, InitImage: config.InitImage, Ports: ports, - InterfaceCount: len(nodeSpec.Interfaces), + InterfaceCount: len(nodeSpec.Interfaces) + 1, InitSleep: int(config.Sleep), Resources: node.ToResourceRequirements(nodeSpec.Constraints), Labels: nodeSpec.Labels, From 5e376cf656ce26fee753f92cce0c1957ede44eeb Mon Sep 17 00:00:00 2001 From: Marco Supino Date: Tue, 24 Mar 2026 09:58:07 +0200 Subject: [PATCH 2/3] retrigger CI Made-with: Cursor From 5062611864e35a79bcc762ed4e46ab0d0a72aa16 Mon Sep 17 00:00:00 2001 From: marco Date: Sun, 12 Apr 2026 10:16:34 +0300 Subject: [PATCH 3/3] Fix CI lint: upgrade golangci-lint v1->v2 and migrate config - Bump openconfig/common-ci to v0.3.0 (golangci-lint-action v6->v9, lint v1->v2) to fix runner timeout on golangci-lint run - Migrate .golangci.yml to v2 format: add version, move gofmt/goimports to formatters section, rename linters-settings -> linters.settings - Add new-from-rev: origin/main to avoid failing on pre-existing debt - Fix QF1008 in drivenets.go: remove redundant .Impl from n.Impl.Proto --- .github/linters/.golangci.yml | 34 ++++++++++++++++++-------------- .github/workflows/go.yml | 4 ++-- topo/node/drivenets/drivenets.go | 6 +++--- 3 files changed, 24 insertions(+), 20 deletions(-) diff --git a/.github/linters/.golangci.yml b/.github/linters/.golangci.yml index 07cf99e4..b6a56531 100644 --- a/.github/linters/.golangci.yml +++ b/.github/linters/.golangci.yml @@ -1,4 +1,6 @@ --- +version: "2" + ######################### ######################### ## Golang Linter rules ## @@ -10,6 +12,7 @@ run: timeout: 10m issues: + new-from-rev: origin/main exclude-rules: - path: _test\.go linters: @@ -27,26 +30,27 @@ linters: enable: - gosec - unconvert - - goimports - - gofmt - gocritic - govet - revive - staticcheck - - unconvert - unparam - unused - wastedassign - whitespace -linters-settings: - errcheck: - # report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`; - # default is false: such cases aren't reported by default. - check-blank: true - gocritic: - disabled-checks: - - singleCaseSwitch - - appendAssign - revive: - ignore-generated-header: true - severity: warning + settings: + errcheck: + # report about assignment of errors to blank identifier: `num, _ := strconv.Atoi(numStr)`; + # default is false: such cases aren't reported by default. + check-blank: true + gocritic: + disabled-checks: + - singleCaseSwitch + - appendAssign + revive: + ignore-generated-header: true + severity: warning +formatters: + enable: + - gofmt + - goimports diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml index c230a47b..d503ebb9 100644 --- a/.github/workflows/go.yml +++ b/.github/workflows/go.yml @@ -9,7 +9,7 @@ on: jobs: go: - uses: openconfig/common-ci/.github/workflows/go.yml@v0.2.0 + uses: openconfig/common-ci/.github/workflows/go.yml@v0.3.0 with: coverage-excludes-regex: /cloudbuild tests-excludes-regex: /cloudbuild @@ -18,4 +18,4 @@ jobs: go-versions: "['1.21']" linter: - uses: openconfig/common-ci/.github/workflows/linter.yml@v0.2.0 + uses: openconfig/common-ci/.github/workflows/linter.yml@v0.3.0 diff --git a/topo/node/drivenets/drivenets.go b/topo/node/drivenets/drivenets.go index 240b2a22..d0672a75 100644 --- a/topo/node/drivenets/drivenets.go +++ b/topo/node/drivenets/drivenets.go @@ -129,7 +129,7 @@ var clientFn = func(c *rest.Config) (clientset.Interface, error) { } func (n *Node) Create(ctx context.Context) error { - if n.Impl.Proto.Model != modelCdnos { + if n.Proto.Model != modelCdnos { return fmt.Errorf("cannot create an instance of an unknown model") } return n.cdnosCreate(ctx) @@ -208,7 +208,7 @@ func (n *Node) cdnosCreate(ctx context.Context) error { } func (n *Node) Status(ctx context.Context) (node.Status, error) { - if n.Impl.Proto.Model != modelCdnos { + if n.Proto.Model != modelCdnos { return node.StatusUnknown, fmt.Errorf("invalid model specified") } return n.cdnosStatus(ctx) @@ -236,7 +236,7 @@ func (n *Node) cdnosStatus(ctx context.Context) (node.Status, error) { } func (n *Node) Delete(ctx context.Context) error { - if n.Impl.Proto.Model != modelCdnos { + if n.Proto.Model != modelCdnos { return fmt.Errorf("unknown model") } return n.cdnosDelete(ctx)