You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds the necessary knobs in the cno to consume the api change exposing
the internal masquerade subnet in ovn-k where we reserve addresses for
ip masquerading
Had to rebase on top of small conflict with addition of logging for
libovsdb in the config yamls
Also adds unit tests and verification in cno for configured masquerade
subnets and corrects some tests/verification of the join subnet
Signed-off-by: Ben Pickard <bpickard@redhat.com>
// v4 and v6 join subnet are used when the user wants to use the addresses that we reserve for the join subnet in ovn-k
123
+
// TODO: this field is being deprecated and will turn into c.GatewayConfig.IPv4/6.InternalJoinSubnet when we introduce the transit switch config into the api
122
124
data.Data["V4JoinSubnet"] =c.V4InternalSubnet
123
125
data.Data["V6JoinSubnet"] =c.V6InternalSubnet
126
+
// v4 and v6InternalMasqueradeSubnet are used when the user wants to use the addresses that we reserve in ovn-k for ip masquerading
out=append(out, errors.Errorf("v4InternalSubnet is invalid: %s", err))
825
834
}
835
+
ifv4JoinNet==nil {
836
+
out=append(out, errors.Errorf("Unable to parse cidr for v4InternalSubnet %s", oc.V4InternalSubnet))
837
+
returnout
838
+
}
826
839
if!isV4InternalSubnetLargeEnough(conf) {
827
-
out=append(out, errors.Errorf("v4InternalSubnet is no large enough for the maximum number of nodes which can be supported by ClusterNetwork"))
840
+
out=append(out, errors.Errorf("v4InternalSubnet %s is not large enough for the maximum number of nodes which can be supported by ClusterNetwork", oc.V4InternalSubnet))
828
841
}
829
842
}
830
843
ifoc.V6InternalSubnet!="" {
831
844
if!cnHasIPv6 {
832
-
out=append(out, errors.Errorf("v6InternalSubnet and ClusterNetwork must have matching IP families"))
845
+
out=append(out, errors.Errorf("v6InternalSubnet %s and ClusterNetwork must have matching IP families", oc.V6InternalSubnet))
out=append(out, errors.Errorf("v6InternalSubnet is invalid: %s", err))
837
850
}
851
+
ifv6JoinNet==nil {
852
+
out=append(out, errors.Errorf("Unable to parse cidr for v6InternalSubnet %s", oc.V6InternalSubnet))
853
+
returnout
854
+
}
838
855
if!isV6InternalSubnetLargeEnough(conf) {
839
-
out=append(out, errors.Errorf("v6InternalSubnet is no large enough for the maximum number of nodes which can be supported by ClusterNetwork"))
856
+
out=append(out, errors.Errorf("v6InternalSubnet %s is not large enough for the maximum number of nodes which can be supported by ClusterNetwork", oc.V6InternalSubnet))
840
857
}
841
858
}
842
859
for_, cn:=rangeconf.ClusterNetwork {
843
860
ifutilnet.IsIPv6CIDRString(cn.CIDR) {
844
861
ifoc.V6InternalSubnet!="" {
845
862
_, v6ClusterNet, _:=net.ParseCIDR(cn.CIDR)
846
-
ifiputil.NetsOverlap(*v6Net, *v6ClusterNet) {
847
-
out=append(out, errors.Errorf("v6InternalSubnet overlaps with ClusterNetwork %s", cn.CIDR))
863
+
ifiputil.NetsOverlap(*v6JoinNet, *v6ClusterNet) {
864
+
out=append(out, errors.Errorf("v6InternalSubnet %s overlaps with ClusterNetwork %s", oc.V6InternalSubnet, cn.CIDR))
848
865
}
849
866
}
850
867
} else {
851
868
ifoc.V4InternalSubnet!="" {
852
869
_, v4ClusterNet, _:=net.ParseCIDR(cn.CIDR)
853
-
ifiputil.NetsOverlap(*v4Net, *v4ClusterNet) {
854
-
out=append(out, errors.Errorf("v4InternalSubnet overlaps with ClusterNetwork %s", cn.CIDR))
870
+
ifiputil.NetsOverlap(*v4JoinNet, *v4ClusterNet) {
871
+
out=append(out, errors.Errorf("v4InternalSubnet %s overlaps with ClusterNetwork %s", oc.V4InternalSubnet, cn.CIDR))
out=append(out, errors.Errorf("v4InternalMasqueradeSubnet %s and ClusterNetwork must have matching IP families", oc.GatewayConfig.IPv4.InternalMasqueradeSubnet))
out=append(out, errors.Errorf("v6InternalMasqueradeSubnet %s and ClusterNetwork must have matching IP families", oc.GatewayConfig.IPv6.InternalMasqueradeSubnet))
0 commit comments