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 and ClusterNetwork must have matching IP families"))
829
+
out=append(out, errors.Errorf("v4InternalSubnet %s and ClusterNetwork must have matching IP families", oc.V4InternalSubnet))
821
830
}
822
831
_, v4Net, err=net.ParseCIDR(oc.V4InternalSubnet)
823
832
iferr!=nil {
824
833
out=append(out, errors.Errorf("v4InternalSubnet is invalid: %s", err))
825
834
}
826
835
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"))
836
+
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
837
}
829
838
}
830
839
ifoc.V6InternalSubnet!="" {
831
840
if!cnHasIPv6 {
832
-
out=append(out, errors.Errorf("v6InternalSubnet and ClusterNetwork must have matching IP families"))
841
+
out=append(out, errors.Errorf("v6InternalSubnet %s and ClusterNetwork must have matching IP families", oc.V6InternalSubnet))
833
842
}
834
843
_, v6Net, err=net.ParseCIDR(oc.V6InternalSubnet)
835
844
iferr!=nil {
836
845
out=append(out, errors.Errorf("v6InternalSubnet is invalid: %s", err))
837
846
}
838
847
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"))
848
+
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
849
}
841
850
}
842
851
for_, cn:=rangeconf.ClusterNetwork {
843
852
ifutilnet.IsIPv6CIDRString(cn.CIDR) {
844
853
ifoc.V6InternalSubnet!="" {
845
854
_, v6ClusterNet, _:=net.ParseCIDR(cn.CIDR)
846
855
ifiputil.NetsOverlap(*v6Net, *v6ClusterNet) {
847
-
out=append(out, errors.Errorf("v6InternalSubnet overlaps with ClusterNetwork %s", cn.CIDR))
856
+
out=append(out, errors.Errorf("v6InternalSubnet %s overlaps with ClusterNetwork %s", oc.V6InternalSubnet, cn.CIDR))
848
857
}
849
858
}
850
859
} else {
851
860
ifoc.V4InternalSubnet!="" {
852
861
_, v4ClusterNet, _:=net.ParseCIDR(cn.CIDR)
853
862
ifiputil.NetsOverlap(*v4Net, *v4ClusterNet) {
854
-
out=append(out, errors.Errorf("v4InternalSubnet overlaps with ClusterNetwork %s", cn.CIDR))
863
+
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