Skip to content

Commit e2d7bb3

Browse files
committed
Return list of errors for both ends of address range if there are any
Signed-off-by: Jiri Podivin <[email protected]>
1 parent d115103 commit e2d7bb3

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

apis/network/v1beta1/netconfig_webhook.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -441,15 +441,13 @@ func valiateAllocationRange(
441441
startAddr := net.ParseIP(allocRange.Start)
442442
if startAddr == nil {
443443
allErrs = append(allErrs, field.Invalid(path.Child("start"), allocRange.Start, errNotIPAddr))
444-
return allErrs
445444
}
446445
endAddr := net.ParseIP(allocRange.End)
447446
if endAddr == nil {
448447
allErrs = append(allErrs, field.Invalid(path.Child("end"), allocRange.End, errNotIPAddr))
449-
return allErrs
450448
}
451449

452-
if startAddr == nil || endAddr == nil {
450+
if len(allErrs) != 0 {
453451
return allErrs
454452
}
455453

0 commit comments

Comments
 (0)