Skip to content

Commit

Permalink
fix: when give ipv4 cidr ipv6 gateway, the gateway will extend infini…
Browse files Browse the repository at this point in the history
…tely (#3865)

Signed-off-by: Changlu Yi <[email protected]>
  • Loading branch information
changluyi authored Mar 25, 2024
1 parent fbec723 commit b48c519
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/controller/subnet.go
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ func checkAndUpdateGateway(subnet *kubeovnv1.Subnet) (bool, error) {
switch {
case subnet.Spec.Gateway == "":
gw, err = util.GetGwByCidr(subnet.Spec.CIDRBlock)
case util.CheckProtocol(subnet.Spec.Gateway) != util.CheckProtocol(subnet.Spec.CIDRBlock):
case subnet.Spec.Protocol == kubeovnv1.ProtocolDual && util.CheckProtocol(subnet.Spec.Gateway) != util.CheckProtocol(subnet.Spec.CIDRBlock):
gw, err = util.AppendGwByCidr(subnet.Spec.Gateway, subnet.Spec.CIDRBlock)
default:
gw = subnet.Spec.Gateway
Expand Down

0 comments on commit b48c519

Please sign in to comment.