Skip to content

Commit 53c7c74

Browse files
committed
Fixed empty path validation
1 parent d2f685f commit 53c7c74

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pkg/apis/storage/v1alpha/local_storage_spec.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,11 @@ func (s LocalStorageSpec) Validate() error {
4545
if len(s.LocalPath) == 0 {
4646
return maskAny(errors.Wrapf(ValidationError, "localPath cannot be empty"))
4747
}
48+
for _, p := range s.LocalPath {
49+
if len(p) == 0 {
50+
return maskAny(errors.Wrapf(ValidationError, "localPath cannot contain empty strings"))
51+
}
52+
}
4853
return nil
4954
}
5055

0 commit comments

Comments
 (0)