update symmetric mode#862
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #862 +/- ##
==========================================
+ Coverage 37.93% 40.30% +2.36%
==========================================
Files 130 130
Lines 18923 19028 +105
==========================================
+ Hits 7179 7669 +490
+ Misses 10934 10513 -421
- Partials 810 846 +36
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…ction - Replace direct type assertion with errors.As() for better error handling - Add explicit error return in case of LinkNotFoundError- Reorder code in FoundRoutes function for better readability and efficiency Signed-off-by: l1b0k <libokang.lbk@alibaba-inc.com>
- Add tests for hostPort connectivity using node IP and external IP- Implement support for IPv6 in connectivity tests - Add helper function to get node IPs - Extend Pod struct with WithHostPort method Signed-off-by: l1b0k <libokang.lbk@alibaba-inc.com>
4a7e661 to
2bdb406
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR updates the symmetric routing functionality in Terway by restructuring the networking configuration code. The main purpose is to replace the previous portmap-specific network configuration with a more general symmetric routing implementation that supports dual-stack networking (IPv4 and IPv6).
- Replaces the
portmap.goimplementation with a newsymmetric.gomodule that handles both IPv4 and IPv6 network rules - Adds configurable symmetric routing through
SymmetricRoutingConfigstructure in CNI configuration - Expands test coverage with comprehensive test suites for network utilities and symmetric routing functionality
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
cmd/terway-cli/symmetric.go |
New symmetric routing implementation supporting dual-stack networking with configurable parameters |
cmd/terway-cli/symmetric_test.go |
Comprehensive test suite for symmetric routing functionality including IPv4, IPv6, and dual-stack scenarios |
plugin/driver/types/types.go |
Adds SymmetricRoutingConfig structure for configurable symmetric routing parameters |
plugin/driver/utils/utils_linux_test.go |
Converts test suite from assert-based to Ginkgo/Gomega BDD-style testing framework |
plugin/driver/utils/utils_linux.go |
Improves error handling in DelLinkByName and fixes route validation logic |
tests/connective_test.go |
Adds host port connectivity tests with support for both IPv4 and IPv6 |
cmd/terway-cli/node.go |
Updates CLI to handle symmetric routing configuration instead of portmap-specific setup |
examples/symmetric_routing_config.json |
Provides example configuration for symmetric routing |
docs/symmetric_routing_config.md |
Documentation for symmetric routing configuration options |
Comments suppressed due to low confidence (1)
1db773d to
b765257
Compare
feef6de to
5033c0b
Compare
- Implement configureIPv4Rules and configureIPv6Rules functions - Update configureNetworkRules to handle both IPv4 and IPv6 - Add tests for IPv6 and dual-stack configurations - Improve error messages and code organization Signed-off-by: l1b0k <libokang.lbk@alibaba-inc.com>
- Add tests for LinkAdd, LinkSetDown, RouteReplace, and RouteDel functions- Implement unit tests for Config struct methods including GetIPPoolSyncPeriod, EnableFeature, DisableFeature, and IsFeatureEnabled - Add tests for GetConfigFromFileWithMerge and related functions - Implement unit tests for PodUseENI and IgnoredByTerway functions- Add tests for IPSet and IPNetSet methods including String, ToRPC, GetIPv4, and GetIPv6 Signed-off-by: l1b0k <libokang.lbk@alibaba-inc.com>
No description provided.