Skip to content

Commit 425cd22

Browse files
author
zhouhao
committed
validate: Modify the validation scope of mounts.destination
Signed-off-by: zhouhao <[email protected]>
1 parent 69626a4 commit 425cd22

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

validate/validate.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -383,15 +383,15 @@ func (v *Validator) CheckMounts() (msgs []string) {
383383
return
384384
}
385385

386-
if supportedTypes != nil {
387-
for _, mount := range v.spec.Mounts {
386+
for _, mount := range v.spec.Mounts {
387+
if supportedTypes != nil {
388388
if !supportedTypes[mount.Type] {
389389
msgs = append(msgs, fmt.Sprintf("Unsupported mount type %q", mount.Type))
390390
}
391+
}
391392

392-
if !filepath.IsAbs(mount.Destination) {
393-
msgs = append(msgs, fmt.Sprintf("destination %v is not an absolute path", mount.Destination))
394-
}
393+
if !filepath.IsAbs(mount.Destination) {
394+
msgs = append(msgs, fmt.Sprintf("destination %v is not an absolute path", mount.Destination))
395395
}
396396
}
397397

0 commit comments

Comments
 (0)