Multi-VAN support - #2564
Conversation
* No new CRDs needed * Network ID can be set through site.spec.networkId * Router Access and Link now accept inter-network role * Router Access and Link now accept spec.routingKeys (inter-network role) * Dynamic port allocation for Router Access (only supported with updated CRD) * CRDs have been updated, but all updates are optional if not using multi-van * Unit and integration tests added
📝 WalkthroughWalkthroughThe change adds multi-VAN fields and routing-key support, dynamic router-access port allocation, CRD capability detection, router network and auto-link synchronization, inter-VAN reconciliation, endpoint filtering, and integration coverage. ChangesMulti-VAN routing and router access
Estimated code review effort: 4 (Complex) | ~60 minutes Merge Risk: 🟠 High · up to This change adds multi-network routing and dynamic port allocation, but current behavior can reject valid allocated ports, halt later router configuration synchronization, and leave failed status updates unreported. These issues can disrupt configuration and resource visibility, so the PR is not merge-ready until they are addressed or explicitly accepted by the owners. Suggested reviewers: 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 6.41% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 78 functions across 29 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1🛠️ Fix failing CI checks 💡
Comment |
There was a problem hiding this comment.
Actionable comments posted: 5
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: a5e06ede-299f-4f21-89a9-0b358c270f1f
📒 Files selected for processing (32)
config/crd/bases/skupper_link_crd.yamlconfig/crd/bases/skupper_router_access_crd.yamlconfig/crd/bases/skupper_site_crd.yamlconfig/rbac/cluster/clusterrole.yamlinternal/cmd/skupper/debug/sweeper/ports_test.gointernal/cmd/skupper/link/kube/link_generate.gointernal/fixtures/skupper_resources.gointernal/kube/adaptor/config_sync.gointernal/kube/client/client.gointernal/kube/client/crds.gointernal/kube/client/crds_test.gointernal/kube/client/fake/fake_client.gointernal/kube/controller/controller.gointernal/kube/grants/tokens.gointernal/kube/site/site.gointernal/kube/site/site_test.gointernal/kube/watchers/watchers.gointernal/ports/ports.gointernal/ports/ports_test.gointernal/qdr/amqp_mgmt.gointernal/qdr/qdr.gointernal/qdr/qdr_test.gointernal/qdr/sync_router_ops.gointernal/site/link.gointernal/site/link_test.gointernal/site/routeraccess.gointernal/site/routeraccess_test.gopkg/apis/skupper/v2alpha1/link_types_test.gopkg/apis/skupper/v2alpha1/types.gopkg/apis/skupper/v2alpha1/zz_generated.deepcopy.gotests/integration/kube/controller/site_test.gotests/integration/kube/controller/suite_test.go
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.
| MAX_PORT = 65435 | ||
| // Ports reserved for dynamic allocation to router accesses | ||
| MIN_ROUTER_PORT = 65436 | ||
| MAX_ROUTER_PORT = 65535 | ||
| ) | ||
|
|
||
| func NewFreePorts() *FreePorts { | ||
| return newFreePortsForRange(MIN_PORT, MAX_PORT) | ||
| } | ||
|
|
||
| func NewFreePortsForRouterAccess() *FreePorts { | ||
| return newFreePortsForRange(MIN_ROUTER_PORT, MAX_ROUTER_PORT) | ||
| } |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Keep the TCP port maximum separate from the general allocation maximum.
At Line 19, MAX_PORT becomes 65435. NewFreePortsForRouterAccess allocates ports through 65535, but the debug sweeper uses MAX_PORT to validate user input. The sweeper now rejects valid router-access ports from 65436 through 65535.
Keep MAX_PORT at 65535, and add a separate constant for the general allocation upper bound.
There was a problem hiding this comment.
I will define a separate constant used by the debug sweeper.
There was a problem hiding this comment.
@fgiorgetti, that approach addresses the validation issue.
Keep the general allocation maximum at 65435. Use the separate TCP port maximum constant in the debug sweeper so it accepts ports through 65535.
You are interacting with an AI system.
c-kruse
left a comment
There was a problem hiding this comment.
Curious if you've got a plan for status for multi-van Links. IIUC these would stay Pending right now.
@c-kruse not yet. I believe it is better to handle it separately. |
* RouterAccess description improved * Debug Sweeper now uses its own constant * Validate port collisions during RouterAccess reconciliation
There was a problem hiding this comment.
Actionable comments posted: 1
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Team
Run ID: 82420edb-7eef-457a-a19b-a9cdbbafdb62
📒 Files selected for processing (7)
config/crd/bases/skupper_router_access_crd.yamlinternal/cmd/skupper/debug/sweeper/ports.gointernal/kube/site/site.gointernal/site/link.gointernal/site/routeraccess.gointernal/site/routeraccess_test.gopkg/apis/skupper/v2alpha1/types.go
🚧 Files skipped from review as they are similar to previous changes (2)
- internal/site/link.go
- config/crd/bases/skupper_router_access_crd.yaml
Included review availability: Your plan provides up to 4 included reviews per hour; 3 remain after this review.
| ) | ||
| } | ||
| la.SetConfigured(err) | ||
| s.updateRouterAccessStatus(la) |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
Propagate the RouterAccess status update error.
If UpdateStatus fails, this path removes the access from active configuration but returns success. The resource can remain without its error status, and the controller does not retry this reconciliation.
Proposed fix
- s.updateRouterAccessStatus(la)
+ if err := s.updateRouterAccessStatus(la); err != nil {
+ return err
+ }📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| s.updateRouterAccessStatus(la) | |
| if err := s.updateRouterAccessStatus(la); err != nil { | |
| return err | |
| } |
🧰 Tools
🪛 golangci-lint (2.12.2)
[error] 1805-1805: Error return value of s.updateRouterAccessStatus is not checked
(errcheck)
Source: Linters/SAST tools
Summary by CodeRabbit
New Features
Bug Fixes