Skip to content

Commit 9027b2e

Browse files
krasoffskiAndiDog
andauthored
Update api/v1beta2/awscluster_webhook.go
Co-authored-by: Andreas Sommer <[email protected]>
1 parent 09931bf commit 9027b2e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

api/v1beta2/awscluster_webhook.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,9 +268,9 @@ func (r *AWSCluster) validateNetwork() field.ErrorList {
268268
allErrs = append(allErrs, r.validateIngressRule(rule)...)
269269
}
270270

271-
for _, cidrBlock := range r.Spec.NetworkSpec.NodePortIngressRuleCidrBlocks {
271+
for cidrBlockIndex, cidrBlock := range r.Spec.NetworkSpec.NodePortIngressRuleCidrBlocks {
272272
if _, _, err := net.ParseCIDR(cidrBlock); err != nil {
273-
allErrs = append(allErrs, field.Invalid(field.NewPath("nodePortIngressRuleCidrBlocks"), r.Spec.NetworkSpec.NodePortIngressRuleCidrBlocks, "CIDR block is invalid"))
273+
allErrs = append(allErrs, field.Invalid(field.NewPath("spec", "network", fmt.Sprintf("nodePortIngressRuleCidrBlocks[%d]", cidrBlockIndex)), r.Spec.NetworkSpec.NodePortIngressRuleCidrBlocks, "CIDR block is invalid"))
274274
}
275275
}
276276

0 commit comments

Comments
 (0)