Skip to content

Commit

Permalink
Fix dual stack create only IPv6 stack
Browse files Browse the repository at this point in the history
Signed-off-by: lou-lan <[email protected]>
  • Loading branch information
lou-lan committed Dec 9, 2024
1 parent 4f12ee7 commit 81c5a2b
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pkg/agent/police.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,12 @@ func (r *policeReconciler) initApplyPolicy() error {
isIgnoreInternalCIDR = true
}

// support enabling IPv4/IPv6 Dual Stack, only create IPv4 or IPv6 EgressGateway
if (table.IPVersion == 4 && (!val.UseNodeIP && val.IP.V4 == "")) ||
(table.IPVersion == 6 && (!val.UseNodeIP && val.IP.V6 == "")) {
continue
}

rule := buildEipRule(policyName, val.IP, table.IPVersion, isIgnoreInternalCIDR, val.UseNodeIP)
if rule != nil {
rules = append(rules, *rule)
Expand Down

0 comments on commit 81c5a2b

Please sign in to comment.