Skip to content

Commit

Permalink
Add validation for default CIDR range
Browse files Browse the repository at this point in the history
  • Loading branch information
rhamitarora committed Jun 11, 2024
1 parent 6a973ea commit 0b16031
Show file tree
Hide file tree
Showing 22 changed files with 650 additions and 28 deletions.
1 change: 1 addition & 0 deletions pkg/api/error.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ const (
CloudErrorCodeRequestDisallowedByPolicy = "RequestDisallowedByPolicy"
CloudErrorCodeInvalidNetworkAddress = "InvalidNetworkAddress"
CloudErrorCodeThrottlingLimitExceeded = "ThrottlingLimitExceeded"
CloudErrorCodeInvalidCIDRRange = "InvalidCIDRRange"
)

// NewCloudError returns a new CloudError
Expand Down
9 changes: 9 additions & 0 deletions pkg/api/openshiftcluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,15 @@ type NetworkProfile struct {
LoadBalancerProfile *LoadBalancerProfile `json:"loadBalancerProfile,omitempty"`
}

// IP address ranges internally used by ARO
var (
JoinCIDRRange []string = []string{
"100.64.0.0/16",
"169.254.169.0/29",
"100.88.0.0/16",
}
)

// PreconfiguredNSG represents whether customers want to use their own NSG attached to the subnets
type PreconfiguredNSG string

Expand Down
15 changes: 14 additions & 1 deletion pkg/api/v20191231preview/openshiftcluster_validatestatic.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,6 @@ func (sv openShiftClusterStaticValidator) validateServicePrincipalProfile(path s

func (sv openShiftClusterStaticValidator) validateNetworkProfile(path string, np *NetworkProfile) error {
podIP, pod, err := net.ParseCIDR(np.PodCIDR)

if err != nil {
return api.NewCloudError(http.StatusBadRequest, api.CloudErrorCodeInvalidParameter, path+".podCidr", "The provided pod CIDR '%s' is invalid: '%s'.", np.PodCIDR, err)
}
Expand All @@ -198,6 +197,13 @@ func (sv openShiftClusterStaticValidator) validateNetworkProfile(path string, np
return api.NewCloudError(http.StatusBadRequest, api.CloudErrorCodeInvalidParameter, path+".podCidr", "The provided pod CIDR '%s' is invalid: must be IPv4.", np.PodCIDR)
}

for _, s := range api.JoinCIDRRange {
_, cidr, _ := net.ParseCIDR(s)
if pod.Contains(cidr.IP) || cidr.Contains(pod.IP) {
return api.NewCloudError(http.StatusBadRequest, api.CloudErrorCodeInvalidCIDRRange, path, "Azure Red Hat OpenShift uses 100.64.0.0/16, 169.254.169.0/29, 100.88.0.0/16, fd98::/64, fd69::/125, and fd97::/64 IP address range internally. Do not include this '%s' IP address range in any other CIDR definitions in your cluster.", np.PodCIDR)
}
}

ones, _ := pod.Mask.Size()
if ones > 18 {
return api.NewCloudError(http.StatusBadRequest, api.CloudErrorCodeInvalidParameter, path+".podCidr", "The provided vnet CIDR '%s' is invalid: must be /18 or larger.", np.PodCIDR)
Expand All @@ -218,6 +224,13 @@ func (sv openShiftClusterStaticValidator) validateNetworkProfile(path string, np
return api.NewCloudError(http.StatusBadRequest, api.CloudErrorCodeInvalidParameter, path+".serviceCidr", "The provided service CIDR '%s' is invalid: must be IPv4.", np.ServiceCIDR)
}

for _, s := range api.JoinCIDRRange {
_, cidr, _ := net.ParseCIDR(s)
if service.Contains(cidr.IP) || cidr.Contains(service.IP) {
return api.NewCloudError(http.StatusBadRequest, api.CloudErrorCodeInvalidCIDRRange, path, "Azure Red Hat OpenShift uses 100.64.0.0/16, 169.254.169.0/29, 100.88.0.0/16, fd98::/64, fd69::/125, and fd97::/64 IP address range internally. Do not include this '%s' IP address range in any other CIDR definitions in your cluster.", np.ServiceCIDR)
}
}

ones, _ = service.Mask.Size()
if ones > 22 {
return api.NewCloudError(http.StatusBadRequest, api.CloudErrorCodeInvalidParameter, path+".serviceCidr", "The provided vnet CIDR '%s' is invalid: must be /22 or larger.", np.ServiceCIDR)
Expand Down
42 changes: 42 additions & 0 deletions pkg/api/v20191231preview/openshiftcluster_validatestatic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,48 @@ func TestOpenShiftClusterStaticValidateNetworkProfile(t *testing.T) {
},
wantErr: "400: InvalidNetworkAddress: properties.networkProfile.serviceCidr: The provided service CIDR '10.0.150.0/16' is invalid, expecting: '10.0.0.0/16'.",
},
{
name: "podCidr invalid CIDR-1",
modify: func(oc *OpenShiftCluster) {
oc.Properties.NetworkProfile.PodCIDR = "100.64.0.0/16"
},
wantErr: "400: InvalidCIDRRange: properties.networkProfile: Azure Red Hat OpenShift uses 100.64.0.0/16, 169.254.169.0/29, 100.88.0.0/16, fd98::/64, fd69::/125, and fd97::/64 IP address range internally. Do not include this '100.64.0.0/16' IP address range in any other CIDR definitions in your cluster.",
},
{
name: "podCidr invalid CIDR-2",
modify: func(oc *OpenShiftCluster) {
oc.Properties.NetworkProfile.PodCIDR = "169.254.169.0/29"
},
wantErr: "400: InvalidCIDRRange: properties.networkProfile: Azure Red Hat OpenShift uses 100.64.0.0/16, 169.254.169.0/29, 100.88.0.0/16, fd98::/64, fd69::/125, and fd97::/64 IP address range internally. Do not include this '169.254.169.0/29' IP address range in any other CIDR definitions in your cluster.",
},
{
name: "podCidr invalid CIDR-3",
modify: func(oc *OpenShiftCluster) {
oc.Properties.NetworkProfile.PodCIDR = "100.88.0.0/16"
},
wantErr: "400: InvalidCIDRRange: properties.networkProfile: Azure Red Hat OpenShift uses 100.64.0.0/16, 169.254.169.0/29, 100.88.0.0/16, fd98::/64, fd69::/125, and fd97::/64 IP address range internally. Do not include this '100.88.0.0/16' IP address range in any other CIDR definitions in your cluster.",
},
{
name: "serviceCidr invalid CIDR-1",
modify: func(oc *OpenShiftCluster) {
oc.Properties.NetworkProfile.ServiceCIDR = "100.64.0.0/16"
},
wantErr: "400: InvalidCIDRRange: properties.networkProfile: Azure Red Hat OpenShift uses 100.64.0.0/16, 169.254.169.0/29, 100.88.0.0/16, fd98::/64, fd69::/125, and fd97::/64 IP address range internally. Do not include this '100.64.0.0/16' IP address range in any other CIDR definitions in your cluster.",
},
{
name: "serviceCidr invalid CIDR-2",
modify: func(oc *OpenShiftCluster) {
oc.Properties.NetworkProfile.ServiceCIDR = "169.254.169.0/29"
},
wantErr: "400: InvalidCIDRRange: properties.networkProfile: Azure Red Hat OpenShift uses 100.64.0.0/16, 169.254.169.0/29, 100.88.0.0/16, fd98::/64, fd69::/125, and fd97::/64 IP address range internally. Do not include this '169.254.169.0/29' IP address range in any other CIDR definitions in your cluster.",
},
{
name: "serviceCidr invalid CIDR-3",
modify: func(oc *OpenShiftCluster) {
oc.Properties.NetworkProfile.ServiceCIDR = "100.88.0.0/16"
},
wantErr: "400: InvalidCIDRRange: properties.networkProfile: Azure Red Hat OpenShift uses 100.64.0.0/16, 169.254.169.0/29, 100.88.0.0/16, fd98::/64, fd69::/125, and fd97::/64 IP address range internally. Do not include this '100.88.0.0/16' IP address range in any other CIDR definitions in your cluster.",
},
}

runTests(t, testModeCreate, tests)
Expand Down
15 changes: 14 additions & 1 deletion pkg/api/v20200430/openshiftcluster_validatestatic.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,17 @@ func (sv openShiftClusterStaticValidator) validateServicePrincipalProfile(path s

func (sv openShiftClusterStaticValidator) validateNetworkProfile(path string, np *NetworkProfile) error {
podIP, pod, err := net.ParseCIDR(np.PodCIDR)

if err != nil {
return api.NewCloudError(http.StatusBadRequest, api.CloudErrorCodeInvalidParameter, path+".podCidr", "The provided pod CIDR '%s' is invalid: '%s'.", np.PodCIDR, err)
}

for _, s := range api.JoinCIDRRange {
_, cidr, _ := net.ParseCIDR(s)
if pod.Contains(cidr.IP) || cidr.Contains(pod.IP) {
return api.NewCloudError(http.StatusBadRequest, api.CloudErrorCodeInvalidCIDRRange, path, "Azure Red Hat OpenShift uses 100.64.0.0/16, 169.254.169.0/29, 100.88.0.0/16, fd98::/64, fd69::/125, and fd97::/64 IP address range internally. Do not include this '%s' IP address range in any other CIDR definitions in your cluster.", np.PodCIDR)
}
}

if pod.IP.To4() == nil {
return api.NewCloudError(http.StatusBadRequest, api.CloudErrorCodeInvalidParameter, path+".podCidr", "The provided pod CIDR '%s' is invalid: must be IPv4.", np.PodCIDR)
}
Expand All @@ -217,6 +223,13 @@ func (sv openShiftClusterStaticValidator) validateNetworkProfile(path string, np
return api.NewCloudError(http.StatusBadRequest, api.CloudErrorCodeInvalidParameter, path+".serviceCidr", "The provided service CIDR '%s' is invalid: '%s'.", np.ServiceCIDR, err)
}

for _, s := range api.JoinCIDRRange {
_, cidr, _ := net.ParseCIDR(s)
if service.Contains(cidr.IP) || cidr.Contains(service.IP) {
return api.NewCloudError(http.StatusBadRequest, api.CloudErrorCodeInvalidCIDRRange, path, "Azure Red Hat OpenShift uses 100.64.0.0/16, 169.254.169.0/29, 100.88.0.0/16, fd98::/64, fd69::/125, and fd97::/64 IP address range internally. Do not include this '%s' IP address range in any other CIDR definitions in your cluster.", np.ServiceCIDR)
}
}

if service.IP.To4() == nil {
return api.NewCloudError(http.StatusBadRequest, api.CloudErrorCodeInvalidParameter, path+".serviceCidr", "The provided service CIDR '%s' is invalid: must be IPv4.", np.ServiceCIDR)
}
Expand Down
42 changes: 42 additions & 0 deletions pkg/api/v20200430/openshiftcluster_validatestatic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,48 @@ func TestOpenShiftClusterStaticValidateNetworkProfile(t *testing.T) {
},
wantErr: "400: InvalidNetworkAddress: properties.networkProfile.serviceCidr: The provided service CIDR '10.0.150.0/16' is invalid, expecting: '10.0.0.0/16'.",
},
{
name: "podCidr invalid CIDR-1",
modify: func(oc *OpenShiftCluster) {
oc.Properties.NetworkProfile.PodCIDR = "100.64.0.0/16"
},
wantErr: "400: InvalidCIDRRange: properties.networkProfile: Azure Red Hat OpenShift uses 100.64.0.0/16, 169.254.169.0/29, 100.88.0.0/16, fd98::/64, fd69::/125, and fd97::/64 IP address range internally. Do not include this '100.64.0.0/16' IP address range in any other CIDR definitions in your cluster.",
},
{
name: "podCidr invalid CIDR-2",
modify: func(oc *OpenShiftCluster) {
oc.Properties.NetworkProfile.PodCIDR = "169.254.169.0/29"
},
wantErr: "400: InvalidCIDRRange: properties.networkProfile: Azure Red Hat OpenShift uses 100.64.0.0/16, 169.254.169.0/29, 100.88.0.0/16, fd98::/64, fd69::/125, and fd97::/64 IP address range internally. Do not include this '169.254.169.0/29' IP address range in any other CIDR definitions in your cluster.",
},
{
name: "podCidr invalid CIDR-3",
modify: func(oc *OpenShiftCluster) {
oc.Properties.NetworkProfile.PodCIDR = "100.88.0.0/16"
},
wantErr: "400: InvalidCIDRRange: properties.networkProfile: Azure Red Hat OpenShift uses 100.64.0.0/16, 169.254.169.0/29, 100.88.0.0/16, fd98::/64, fd69::/125, and fd97::/64 IP address range internally. Do not include this '100.88.0.0/16' IP address range in any other CIDR definitions in your cluster.",
},
{
name: "serviceCidr invalid CIDR-1",
modify: func(oc *OpenShiftCluster) {
oc.Properties.NetworkProfile.ServiceCIDR = "100.64.0.0/16"
},
wantErr: "400: InvalidCIDRRange: properties.networkProfile: Azure Red Hat OpenShift uses 100.64.0.0/16, 169.254.169.0/29, 100.88.0.0/16, fd98::/64, fd69::/125, and fd97::/64 IP address range internally. Do not include this '100.64.0.0/16' IP address range in any other CIDR definitions in your cluster.",
},
{
name: "serviceCidr invalid CIDR-2",
modify: func(oc *OpenShiftCluster) {
oc.Properties.NetworkProfile.ServiceCIDR = "169.254.169.0/29"
},
wantErr: "400: InvalidCIDRRange: properties.networkProfile: Azure Red Hat OpenShift uses 100.64.0.0/16, 169.254.169.0/29, 100.88.0.0/16, fd98::/64, fd69::/125, and fd97::/64 IP address range internally. Do not include this '169.254.169.0/29' IP address range in any other CIDR definitions in your cluster.",
},
{
name: "serviceCidr invalid CIDR-3",
modify: func(oc *OpenShiftCluster) {
oc.Properties.NetworkProfile.ServiceCIDR = "100.88.0.0/16"
},
wantErr: "400: InvalidCIDRRange: properties.networkProfile: Azure Red Hat OpenShift uses 100.64.0.0/16, 169.254.169.0/29, 100.88.0.0/16, fd98::/64, fd69::/125, and fd97::/64 IP address range internally. Do not include this '100.88.0.0/16' IP address range in any other CIDR definitions in your cluster.",
},
}

runTests(t, testModeCreate, tests)
Expand Down
21 changes: 20 additions & 1 deletion pkg/api/v20210901preview/openshiftcluster_validatestatic.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ func (sv openShiftClusterStaticValidator) validateServicePrincipalProfile(path s

func (sv openShiftClusterStaticValidator) validateNetworkProfile(path string, np *NetworkProfile) error {
podIP, pod, err := net.ParseCIDR(np.PodCIDR)

if err != nil {
return api.NewCloudError(http.StatusBadRequest, api.CloudErrorCodeInvalidParameter, path+".podCidr", "The provided pod CIDR '%s' is invalid: '%s'.", np.PodCIDR, err)
}
Expand All @@ -201,6 +200,16 @@ func (sv openShiftClusterStaticValidator) validateNetworkProfile(path string, np
return api.NewCloudError(http.StatusBadRequest, api.CloudErrorCodeInvalidParameter, path+".podCidr", "The provided pod CIDR '%s' is invalid: must be IPv4.", np.PodCIDR)
}

switch np.SoftwareDefinedNetwork {
case SoftwareDefinedNetworkOVNKubernetes:
for _, s := range api.JoinCIDRRange {
_, cidr, _ := net.ParseCIDR(s)
if pod.Contains(cidr.IP) || cidr.Contains(pod.IP) {
return api.NewCloudError(http.StatusBadRequest, api.CloudErrorCodeInvalidCIDRRange, path, "Azure Red Hat OpenShift uses 100.64.0.0/16, 169.254.169.0/29, 100.88.0.0/16, fd98::/64, fd69::/125, and fd97::/64 IP address range internally. Do not include this '%s' IP address range in any other CIDR definitions in your cluster.", np.PodCIDR)
}
}
}

ones, _ := pod.Mask.Size()
if ones > 18 {
return api.NewCloudError(http.StatusBadRequest, api.CloudErrorCodeInvalidParameter, path+".podCidr", "The provided vnet CIDR '%s' is invalid: must be /18 or larger.", np.PodCIDR)
Expand All @@ -221,6 +230,16 @@ func (sv openShiftClusterStaticValidator) validateNetworkProfile(path string, np
return api.NewCloudError(http.StatusBadRequest, api.CloudErrorCodeInvalidParameter, path+".serviceCidr", "The provided service CIDR '%s' is invalid: must be IPv4.", np.ServiceCIDR)
}

switch np.SoftwareDefinedNetwork {
case SoftwareDefinedNetworkOVNKubernetes:
for _, s := range api.JoinCIDRRange {
_, cidr, _ := net.ParseCIDR(s)
if service.Contains(cidr.IP) || cidr.Contains(service.IP) {
return api.NewCloudError(http.StatusBadRequest, api.CloudErrorCodeInvalidCIDRRange, path, "Azure Red Hat OpenShift uses 100.64.0.0/16, 169.254.169.0/29, 100.88.0.0/16, fd98::/64, fd69::/125, and fd97::/64 IP address range internally. Do not include this '%s' IP address range in any other CIDR definitions in your cluster.", np.ServiceCIDR)
}
}
}

ones, _ = service.Mask.Size()
if ones > 22 {
return api.NewCloudError(http.StatusBadRequest, api.CloudErrorCodeInvalidParameter, path+".serviceCidr", "The provided vnet CIDR '%s' is invalid: must be /22 or larger.", np.ServiceCIDR)
Expand Down
42 changes: 42 additions & 0 deletions pkg/api/v20210901preview/openshiftcluster_validatestatic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -501,6 +501,48 @@ func TestOpenShiftClusterStaticValidateNetworkProfile(t *testing.T) {
},
wantErr: "400: InvalidNetworkAddress: properties.networkProfile.serviceCidr: The provided service CIDR '10.0.150.0/16' is invalid, expecting: '10.0.0.0/16'.",
},
{
name: "podCidr invalid CIDR-1",
modify: func(oc *OpenShiftCluster) {
oc.Properties.NetworkProfile.PodCIDR = "100.64.0.0/16"
},
wantErr: "400: InvalidCIDRRange: properties.networkProfile: Azure Red Hat OpenShift uses 100.64.0.0/16, 169.254.169.0/29, 100.88.0.0/16, fd98::/64, fd69::/125, and fd97::/64 IP address range internally. Do not include this '100.64.0.0/16' IP address range in any other CIDR definitions in your cluster.",
},
{
name: "podCidr invalid CIDR-2",
modify: func(oc *OpenShiftCluster) {
oc.Properties.NetworkProfile.PodCIDR = "169.254.169.0/29"
},
wantErr: "400: InvalidCIDRRange: properties.networkProfile: Azure Red Hat OpenShift uses 100.64.0.0/16, 169.254.169.0/29, 100.88.0.0/16, fd98::/64, fd69::/125, and fd97::/64 IP address range internally. Do not include this '169.254.169.0/29' IP address range in any other CIDR definitions in your cluster.",
},
{
name: "podCidr invalid CIDR-3",
modify: func(oc *OpenShiftCluster) {
oc.Properties.NetworkProfile.PodCIDR = "100.88.0.0/16"
},
wantErr: "400: InvalidCIDRRange: properties.networkProfile: Azure Red Hat OpenShift uses 100.64.0.0/16, 169.254.169.0/29, 100.88.0.0/16, fd98::/64, fd69::/125, and fd97::/64 IP address range internally. Do not include this '100.88.0.0/16' IP address range in any other CIDR definitions in your cluster.",
},
{
name: "serviceCidr invalid CIDR-1",
modify: func(oc *OpenShiftCluster) {
oc.Properties.NetworkProfile.ServiceCIDR = "100.64.0.0/16"
},
wantErr: "400: InvalidCIDRRange: properties.networkProfile: Azure Red Hat OpenShift uses 100.64.0.0/16, 169.254.169.0/29, 100.88.0.0/16, fd98::/64, fd69::/125, and fd97::/64 IP address range internally. Do not include this '100.64.0.0/16' IP address range in any other CIDR definitions in your cluster.",
},
{
name: "serviceCidr invalid CIDR-2",
modify: func(oc *OpenShiftCluster) {
oc.Properties.NetworkProfile.ServiceCIDR = "169.254.169.0/29"
},
wantErr: "400: InvalidCIDRRange: properties.networkProfile: Azure Red Hat OpenShift uses 100.64.0.0/16, 169.254.169.0/29, 100.88.0.0/16, fd98::/64, fd69::/125, and fd97::/64 IP address range internally. Do not include this '169.254.169.0/29' IP address range in any other CIDR definitions in your cluster.",
},
{
name: "serviceCidr invalid CIDR-3",
modify: func(oc *OpenShiftCluster) {
oc.Properties.NetworkProfile.ServiceCIDR = "100.88.0.0/16"
},
wantErr: "400: InvalidCIDRRange: properties.networkProfile: Azure Red Hat OpenShift uses 100.64.0.0/16, 169.254.169.0/29, 100.88.0.0/16, fd98::/64, fd69::/125, and fd97::/64 IP address range internally. Do not include this '100.88.0.0/16' IP address range in any other CIDR definitions in your cluster.",
},
}

runTests(t, testModeCreate, commontests)
Expand Down
15 changes: 14 additions & 1 deletion pkg/api/v20220401/openshiftcluster_validatestatic.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,6 @@ func (sv openShiftClusterStaticValidator) validateServicePrincipalProfile(path s

func (sv openShiftClusterStaticValidator) validateNetworkProfile(path string, np *NetworkProfile) error {
podIP, pod, err := net.ParseCIDR(np.PodCIDR)

if err != nil {
return api.NewCloudError(http.StatusBadRequest, api.CloudErrorCodeInvalidParameter, path+".podCidr", "The provided pod CIDR '%s' is invalid: '%s'.", np.PodCIDR, err)
}
Expand All @@ -207,6 +206,13 @@ func (sv openShiftClusterStaticValidator) validateNetworkProfile(path string, np
return api.NewCloudError(http.StatusBadRequest, api.CloudErrorCodeInvalidParameter, path+".podCidr", "The provided pod CIDR '%s' is invalid: must be IPv4.", np.PodCIDR)
}

for _, s := range api.JoinCIDRRange {
_, cidr, _ := net.ParseCIDR(s)
if pod.Contains(cidr.IP) || cidr.Contains(pod.IP) {
return api.NewCloudError(http.StatusBadRequest, api.CloudErrorCodeInvalidCIDRRange, path, "Azure Red Hat OpenShift uses 100.64.0.0/16, 169.254.169.0/29, 100.88.0.0/16, fd98::/64, fd69::/125, and fd97::/64 IP address range internally. Do not include this '%s' IP address range in any other CIDR definitions in your cluster.", np.PodCIDR)
}
}

ones, _ := pod.Mask.Size()
if ones > 18 {
return api.NewCloudError(http.StatusBadRequest, api.CloudErrorCodeInvalidParameter, path+".podCidr", "The provided vnet CIDR '%s' is invalid: must be /18 or larger.", np.PodCIDR)
Expand All @@ -227,6 +233,13 @@ func (sv openShiftClusterStaticValidator) validateNetworkProfile(path string, np
return api.NewCloudError(http.StatusBadRequest, api.CloudErrorCodeInvalidParameter, path+".serviceCidr", "The provided service CIDR '%s' is invalid: must be IPv4.", np.ServiceCIDR)
}

for _, s := range api.JoinCIDRRange {
_, cidr, _ := net.ParseCIDR(s)
if service.Contains(cidr.IP) || cidr.Contains(service.IP) {
return api.NewCloudError(http.StatusBadRequest, api.CloudErrorCodeInvalidCIDRRange, path, "Azure Red Hat OpenShift uses 100.64.0.0/16, 169.254.169.0/29, 100.88.0.0/16, fd98::/64, fd69::/125, and fd97::/64 IP address range internally. Do not include this '%s' IP address range in any other CIDR definitions in your cluster.", np.ServiceCIDR)
}
}

ones, _ = service.Mask.Size()
if ones > 22 {
return api.NewCloudError(http.StatusBadRequest, api.CloudErrorCodeInvalidParameter, path+".serviceCidr", "The provided vnet CIDR '%s' is invalid: must be /22 or larger.", np.ServiceCIDR)
Expand Down
Loading

0 comments on commit 0b16031

Please sign in to comment.