Skip to content

Commit 0796f2f

Browse files
RobertLuciandeliahu
authored andcommitted
Allow any CIDR range on the api/operator whitelist (#2363)
(cherry picked from commit 8d31e85)
1 parent a2e7cca commit 0796f2f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

pkg/types/clusterconfig/cluster_config.go

+10-1
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,7 @@ var CoreConfigStructFieldValidations = []*cr.StructFieldValidation{
663663
{
664664
StructField: "VPCCIDR",
665665
StringPtrValidation: &cr.StringPtrValidation{
666-
Validator: validateCIDR,
666+
Validator: validateVPCCIDR,
667667
},
668668
},
669669
}
@@ -1470,6 +1470,15 @@ func (ng *NodeGroup) FillEmptySpotFields(region string) {
14701470
}
14711471

14721472
func validateCIDR(cidr string) (string, error) {
1473+
_, _, err := net.ParseCIDR(cidr)
1474+
if err != nil {
1475+
return "", errors.WithStack(err)
1476+
}
1477+
1478+
return cidr, nil
1479+
}
1480+
1481+
func validateVPCCIDR(cidr string) (string, error) {
14731482
_, network, err := net.ParseCIDR(cidr)
14741483
if err != nil {
14751484
return "", errors.WithStack(err)

0 commit comments

Comments
 (0)