not allow backsteps in local volume plugin

This commit is contained in:
Di Xu
2017-06-17 12:57:01 +08:00
parent 5262a3731c
commit aa23ed53c2
5 changed files with 50 additions and 8 deletions

View File

@@ -1133,7 +1133,10 @@ func validateLocalVolumeSource(ls *api.LocalVolumeSource, fldPath *field.Path) f
allErrs := field.ErrorList{}
if ls.Path == "" {
allErrs = append(allErrs, field.Required(fldPath.Child("path"), ""))
return allErrs
}
allErrs = append(allErrs, validatePathNoBacksteps(ls.Path, fldPath.Child("path"))...)
return allErrs
}