validate the name of named volume

Signed-off-by: xlgao-zju <xlgao@zju.edu.cn>
This commit is contained in:
xlgao-zju
2015-10-22 15:07:07 -04:00
committed by Tibor Vass
parent d2e25ed81c
commit b576f54b73
3 changed files with 19 additions and 0 deletions
+8
View File
@@ -385,6 +385,14 @@ var (
HTTPStatusCode: http.StatusInternalServerError,
})
// 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,
})
// ErrorCodeVolumeFromBlank is generated when path to a volume is blank.
ErrorCodeVolumeFromBlank = errcode.Register(errGroup, errcode.ErrorDescriptor{
Value: "VOLUMEFROMBLANK",