Skip to content

Commit ef4bccf

Browse files
committed
Clean up the ugliest unit test ever
This volume-validation test was a disaster. Better now, if longer to scroll-through.
1 parent 54e92bb commit ef4bccf

File tree

2 files changed

+936
-265
lines changed

2 files changed

+936
-265
lines changed

pkg/api/validation/validation.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -778,6 +778,7 @@ func validateLocalDescendingPath(targetPath string, fldPath *field.Path) field.E
778778
for _, item := range parts {
779779
if item == ".." {
780780
allErrs = append(allErrs, field.Invalid(fldPath, targetPath, "must not contain '..'"))
781+
break // even for `../../..`, one error is sufficient to make the point
781782
}
782783
}
783784
return allErrs

0 commit comments

Comments
 (0)