Skip to content

feat: propagate multi-port status to WgGatewayServer and GatewayServer - #3337

Open
MircoBarone wants to merge 3 commits into
liqotech:masterfrom
MircoBarone:PR11-multitunnel-servicestatus
Open

MircoBarone wants to merge 3 commits into
liqotech:masterfrom
MircoBarone:PR11-multitunnel-servicestatus

Conversation

@MircoBarone

@MircoBarone MircoBarone commented Jul 23, 2026 •

Copy link
Copy Markdown
Contributor

Context & Motivation

Part of the multi-tunnel WireGuard implementation (7th PR related to #3225).

The controller (wggatewayserver_controller.go) must publish all exposed server ports in the status of the WgGatewayServer and GatewayServer resources.

While EndpointStatus has already been extended to support multiple ports, the status-forging logic was still reporting only a single port. This PR updates the controller to collect all the ports exposed by the underlying Kubernetes Service and propagate them through the CRD status.

Solution

  • Updated forgeEndpointStatusClusterIP, forgeEndpointStatusNodePort, and forgeEndpointStatusLoadBalancer in wggatewayserver_controller.go.
    • If the Service exposes a single port, the existing single-port behavior is preserved to maintain full backward compatibility.
    • If the Service exposes multiple ports, all exposed ports (or NodePorts for NodePort Services) are collected and populated in the EndpointStatus.Ports field.
  • Extended ParseEndpoint in getters.go (controller-manager) to parse the ports field, ensuring that multi-port endpoint information is correctly deserialized and propagated when copying the status between WgGatewayServer and GatewayServer.

Tests

Added unit tests for ParseEndpoint and for the ClusterIP and LoadBalancer endpoint status forging, covering the single-port and multi-port cases. The NodePort variant is not covered.

@adamjensenbot

Copy link
Copy Markdown
Collaborator

Hi @MircoBarone. Thanks for your PR!

I am @adamjensenbot.
You can interact with me issuing a slash command in the first line of a comment.
Currently, I understand the following commands:

  • /rebase: Rebase this PR onto the master branch (You can add the option test=true to launch the tests
    when the rebase operation is completed)
  • /merge: Merge this PR into the master branch
  • /build Build Liqo components
  • /test Launch the E2E and Unit tests
  • /hold, /unhold Add/remove the hold label to prevent merging with /merge

Make sure this PR appears in the liqo changelog, adding one of the following labels:

  • feat: 🚀 New Feature
  • fix: 🐛 Bug Fix
  • refactor: 🧹 Code Refactoring
  • docs: 📝 Documentation
  • style: 💄 Code Style
  • perf: 🐎 Performance Improvement
  • test: ✅ Tests
  • chore: 🚚 Dependencies Management
  • build: 📦 Builds Management
  • ci: 👷 CI/CD
  • revert: ⏪ Reverts Previous Changes

@github-actions github-actions Bot added the feat Adds a new feature to the codebase label Jul 23, 2026
@MircoBarone
MircoBarone force-pushed the PR11-multitunnel-servicestatus branch from e8d55c6 to aafe56e Compare July 23, 2026 20:21
@github-actions github-actions Bot added the fix Fixes a bug in the codebase. label Jul 23, 2026
@MircoBarone
MircoBarone force-pushed the PR11-multitunnel-servicestatus branch 3 times, most recently from 3986956 to 044fde1 Compare August 17, 2026 19:04
@MircoBarone
MircoBarone force-pushed the PR11-multitunnel-servicestatus branch 5 times, most recently from b768e27 to ae06a5a Compare August 25, 2026 21:05
@MircoBarone
MircoBarone force-pushed the PR11-multitunnel-servicestatus branch 2 times, most recently from 3dd1e01 to 2b20f84 Compare September 10, 2026 16:42
@MircoBarone
MircoBarone force-pushed the PR11-multitunnel-servicestatus branch 4 times, most recently from 35d4168 to b9df8a9 Compare September 19, 2026 00:11
@MircoBarone
MircoBarone force-pushed the PR11-multitunnel-servicestatus branch 2 times, most recently from 203384d to 8d70cfe Compare September 24, 2026 16:40
@pull-request-size pull-request-size Bot added size/L and removed size/M labels Oct 5, 2026
@MircoBarone
MircoBarone force-pushed the PR11-multitunnel-servicestatus branch 3 times, most recently from 68d98d1 to b20a151 Compare October 6, 2026 19:52
@github-actions github-actions Bot added the test Adds or updates tests for the codebase label Oct 6, 2026
@MircoBarone
MircoBarone force-pushed the PR11-multitunnel-servicestatus branch 2 times, most recently from 58d4ed1 to 6151154 Compare October 12, 2026 22:26
@MircoBarone
MircoBarone force-pushed the PR11-multitunnel-servicestatus branch 2 times, most recently from 136e7f7 to 48407e6 Compare October 14, 2026 20:12
Tests added:
- pkg/liqo-controller-manager/networking/external-network/utils/getters_test.go:
  ParseEndpoint
- pkg/liqo-controller-manager/networking/external-network/wireguard/wggatewayserver_controller_test.go:
  forgeEndpointStatusClusterIP, forgeEndpointStatusLoadBalancer

Notes:
- forgeEndpointStatusNodePort is not covered, as it requires an active
  gateway pod and a node in the fake client.
- ParseEndpoint tests cover only the ports field; the other fields are
  parsed with unchecked type assertions and are left out of scope.
@MircoBarone
MircoBarone force-pushed the PR11-multitunnel-servicestatus branch from 48407e6 to 0e1125a Compare October 15, 2026 20:39

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat Adds a new feature to the codebase fix Fixes a bug in the codebase. size/L test Adds or updates tests for the codebase

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants