Skip to content

update symmetric mode#862

Merged
BSWANG merged 4 commits intoAliyunContainerService:mainfrom
l1b0k:main
Jul 31, 2025
Merged

update symmetric mode#862
BSWANG merged 4 commits intoAliyunContainerService:mainfrom
l1b0k:main

Conversation

@l1b0k
Copy link
Collaborator

@l1b0k l1b0k commented Jul 30, 2025

No description provided.

@l1b0k l1b0k requested a review from BSWANG July 30, 2025 02:36
@codecov
Copy link

codecov bot commented Jul 30, 2025

Codecov Report

❌ Patch coverage is 82.05128% with 42 lines in your changes missing coverage. Please review.
✅ Project coverage is 40.30%. Comparing base (8563d94) to head (72ffc63).
⚠️ Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
cmd/terway-cli/symmetric.go 82.32% 23 Missing and 12 partials ⚠️
cmd/terway-cli/node.go 64.70% 5 Missing and 1 partial ⚠️
plugin/driver/utils/utils_linux.go 87.50% 1 Missing ⚠️
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     
Flag Coverage Δ
unittests 40.30% <82.05%> (+2.36%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

l1b0k added 2 commits July 30, 2025 10:50
…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>
@l1b0k l1b0k force-pushed the main branch 3 times, most recently from 4a7e661 to 2bdb406 Compare July 30, 2025 06:08
@BSWANG BSWANG requested a review from Copilot July 30, 2025 06:36
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.go implementation with a new symmetric.go module that handles both IPv4 and IPv6 network rules
  • Adds configurable symmetric routing through SymmetricRoutingConfig structure 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)

@l1b0k l1b0k force-pushed the main branch 2 times, most recently from 1db773d to b765257 Compare July 30, 2025 08:18
@l1b0k l1b0k force-pushed the main branch 3 times, most recently from feef6de to 5033c0b Compare July 31, 2025 02:55
@l1b0k l1b0k requested a review from BSWANG July 31, 2025 03:13
l1b0k added 2 commits July 31, 2025 11:22
- 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>
@BSWANG BSWANG merged commit 21ad6aa into AliyunContainerService:main Jul 31, 2025
9 checks passed
cursor bot pushed a commit that referenced this pull request Sep 7, 2025
update symmetric mode
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants