Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What type of this PR
Which issue(s) this PR fixes:
Fixes #(issue-number)
WHAT
🤖 Generated by Copilot at 626fb16
This pull request adds IPv6 support and fixes some bugs for the VPC NAT gateway feature. It modifies several files in
pkg/controller
andpkg/ipam
to handle dual-stack EIP and internal IPs and CIDRs, subnet masks, and data sources. It also updates the unit test intest/unittest/ipam/ipam.go
to reflect the changes.🤖 Generated by Copilot at 626fb16
HOW
🤖 Generated by Copilot at 626fb16
handleInitVpcNatGw
function to support multiple service cluster IP ranges and gateway IPs for IPv4 and IPv6 (link)handleUpdateNatGwSubnetRoute
function to use thesubnetsLister
instead of theipam
to get the subnet information, and to support IPv6 external and internal subnets and dual-stack subnets (link, link, link, link, link, link)handleAddIptablesEip
,handleUpdateIptablesEip
,createEipInPod
, anddeleteEipInPod
functions to support IPv6 EIP for the VPC NAT gateway feature (link, link, link, link, link, link, link, link, link, link)handleAddIptablesFip
,handleUpdateIptablesFip
,createFipInPod
, anddeleteFipInPod
functions to support IPv6 EIP and dual-stack internal IPs for the VPC NAT gateway feature (link, link, link, link, link, link)handleAddIptablesDnatRule
,handleUpdateIptablesDnatRule
,createDnatInPod
, anddeleteDnatInPod
functions to support IPv6 EIP and dual-stack internal IPs for the VPC NAT gateway feature (link, link, link, link, link, link)handleAddIptablesSnatRule
,handleUpdateIptablesSnatRule
,createSnatInPod
, anddeleteSnatInPod
functions to support IPv6 EIP and dual-stack internal CIDRs for the VPC NAT gateway feature (link, link, link, link, link, link, link, link, link)patchFipLabel
,patchDnatLabel
, andpatchSnatLabel
functions to use the correct label key and value for the FIP, DNAT, and SNAT objects, and to avoid conflicts with other DNAT rules that use the same EIP (link, link, link)patchSnatStatus
function to support dual-stack internal CIDRs for the VPC NAT gateway feature (link)GetSubnetV4Mask
function to rename it toGetSubnetMask
and return both the IPv4 and IPv6 masks of the subnet (link)AddOrUpdateSubnet
function to use theGetSubnetMask
function instead of theGetSubnetV4Mask
function to get the subnet mask (link)handleUpdateVpcFloatingIp
,handleUpdateVpcEip
,handleUpdateVpcSnat
,handleUpdateVpcDnat
,handleUpdateIptablesEip
,handleUpdateIptablesFip
, andhandleUpdateIptablesDnatRule
functions to use consistent and clear terms (link, link, link, link, link, link, link, link)strings
package to the imports of thepkg/controller/vpc_nat_gw_nat.go
file (link)pkg/controller/vpc_nat_gw_nat.go
file to improve the code formatting and readability (link, link, link, link, link, link, link, link, link)