Validate volume paths do not have ':'

This commit is contained in:
Tim Hockin
2016-02-29 13:22:45 -08:00
parent d1d036391a
commit 56be551416
10 changed files with 14 additions and 10 deletions

View File

@@ -1091,6 +1091,8 @@ func validateVolumeMounts(mounts []api.VolumeMount, volumes sets.String, fldPath
}
if len(mnt.MountPath) == 0 {
allErrs = append(allErrs, field.Required(idxPath.Child("mountPath"), ""))
} else if strings.Contains(mnt.MountPath, ":") {
allErrs = append(allErrs, field.Invalid(idxPath.Child("mountPath"), mnt.MountPath, "must not contain ':'"))
}
}
return allErrs