Baned backslash in group name

pull/99/head
Doflatango 2018-07-18 14:57:28 +08:00
parent 3fe62f5fb0
commit 0e3745c384
2 changed files with 3 additions and 3 deletions

View File

@ -120,7 +120,7 @@ func (c *Client) DelLock(key string) error {
}
func IsValidAsKeyPath(s string) bool {
return strings.IndexByte(s, '/') == -1
return strings.IndexAny(s, "/\\") == -1
}
// etcdTimeoutContext return better error info

View File

@ -8,8 +8,8 @@ var (
ErrEmptyJobName = errors.New("Name of job is empty.")
ErrEmptyJobCommand = errors.New("Command of job is empty.")
ErrIllegalJobId = errors.New("Invalid id that includes illegal characters such as '/'.")
ErrIllegalJobGroupName = errors.New("Invalid job group name that includes illegal characters such as '/'.")
ErrIllegalJobId = errors.New("Invalid id that includes illegal characters such as '/' '\\'.")
ErrIllegalJobGroupName = errors.New("Invalid job group name that includes illegal characters such as '/' '\\'.")
ErrEmptyNodeGroupName = errors.New("Name of node group is empty.")
ErrIllegalNodeGroupId = errors.New("Invalid node group id that includes illegal characters such as '/'.")