Skip to content

Commit

Permalink
fix(platform): validate cidr does not work (#2158)
Browse files Browse the repository at this point in the history
  • Loading branch information
wl-chen authored Nov 9, 2022
1 parent f8ddc2d commit 353cc88
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/platform/provider/baremetal/validation/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ func ValidateCIDRs(cls *platform.Cluster, specPath *field.Path) field.ErrorList
if err != nil {
allErrs = append(allErrs, field.Invalid(path, cidr, "must be a valid CIDR block (e.g. 10.100.0.0/16 or fde4:8dba:82e1::/48)"))
}
if path == specPath.Child("clusterCIDR") {
if path.String() == specPath.Child("clusterCIDR").String() {
clusterCIDR = cidrX
for i, mc := range cls.Spec.Machines {
if clusterCIDR.Contains(net.ParseIP(mc.IP)) {
Expand Down

0 comments on commit 353cc88

Please sign in to comment.