mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Make volumes opts more strict
This commit is contained in:
parent
0c758e9312
commit
2bbc90e92f
1 changed files with 4 additions and 0 deletions
4
opts.go
4
opts.go
|
@ -100,6 +100,10 @@ func ValidateLink(val string) (string, error) {
|
|||
func ValidatePath(val string) (string, error) {
|
||||
var containerPath string
|
||||
|
||||
if strings.Count(val, ":") > 2 {
|
||||
return val, fmt.Errorf("bad format for volumes: %s", val)
|
||||
}
|
||||
|
||||
splited := strings.SplitN(val, ":", 2)
|
||||
if len(splited) == 1 {
|
||||
containerPath = splited[0]
|
||||
|
|
Loading…
Reference in a new issue