Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pkg/types/validation/installconfig.go
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,7 @@ func validateNetworkNotOverlapDefaultOVNSubnets(n *types.Networking, network *ne
subnetsCheck := func(joinSubnet, transitSubnet, masqueradeSubnet *net.IPNet) {
// Join subnet
if ovnsubnet, configured := getOVNSubnet(joinSubnet); !configured && validate.DoCIDRsOverlap(network, ovnsubnet) {
allErrs = append(allErrs, field.Invalid(fldPath, network.String(), fmt.Sprintf("must not overlap with OVNKubernetes default internal subnet %s", ovnsubnet.String())))
allErrs = append(allErrs, field.Invalid(fldPath, network.String(), fmt.Sprintf("must not overlap with OVNKubernetes default internal subnet %s: please run 'openshift-install explain installconfig.networking.ovnKubernetesConfig.ipv4' for further documentation", ovnsubnet.String())))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this code checks for both ipv4 and ipv6:

if network.IP.To4() != nil {
subnetsCheck(validate.OVNIPv4JoinSubnet, validate.OVNIPv4TransitSubnet, validate.OVNIPv4MasqueradeSubnet)
} else {
subnetsCheck(validate.OVNIPv6JoinSubnet, validate.OVNIPv6TransitSubnet, validate.OVNIPv6MasqueradeSubnet)
}

As of now, we only have overrides for ipv4. For future proof, maybe we can use the message:

Suggested change
allErrs = append(allErrs, field.Invalid(fldPath, network.String(), fmt.Sprintf("must not overlap with OVNKubernetes default internal subnet %s: please run 'openshift-install explain installconfig.networking.ovnKubernetesConfig.ipv4' for further documentation", ovnsubnet.String())))
allErrs = append(allErrs, field.Invalid(fldPath, network.String(), fmt.Sprintf("must not overlap with OVNKubernetes default internal subnet %s. To override the OVNKubernetes defaults, configure the field 'networking.ovnKubernetesConfig'", ovnsubnet.String())))

}

// Transit subnet
Expand Down