mirror of
https://github.com/moby/moby.git
synced 2026-06-30 19:58:03 +00:00
Move volume name validation to the local driver.
Delegate validation tasks to the volume drivers. It's up to them to decide whether a name is valid or not. Restrict volume names for the local driver to prevent creating mount points outside docker's volumes directory. Signed-off-by: David Calavera <david.calavera@gmail.com>
This commit is contained in:
@@ -387,10 +387,10 @@ var (
|
||||
|
||||
// ErrorCodeVolumeName is generated when the name of named volume isn't valid.
|
||||
ErrorCodeVolumeName = errcode.Register(errGroup, errcode.ErrorDescriptor{
|
||||
Value: "VOLUMENAME",
|
||||
Message: "%s looks like a relative path, but it's taken as a name. And it is not a valid name.",
|
||||
Description: "The name of named volume is invalid",
|
||||
HTTPStatusCode: http.StatusInternalServerError,
|
||||
Value: "VOLUME_NAME_INVALID",
|
||||
Message: "%s includes invalid characters for a local volume name, only %s are allowed",
|
||||
Description: "The name of volume is invalid",
|
||||
HTTPStatusCode: http.StatusBadRequest,
|
||||
})
|
||||
|
||||
// ErrorCodeVolumeFromBlank is generated when path to a volume is blank.
|
||||
|
||||
Reference in New Issue
Block a user