Harmonize / across all name-related commands

Docker-DCO-1.1-Signed-off-by: Djibril Koné <kone.djibril@gmail.com> (github: enokd)

Harmonize / across all name-related commands

Docker-DCO-1.1-Signed-off-by: Djibril Koné <kone.djibril@gmail.com> (github: enokd)

Harmonize / across all name-related commands:Return an error when repeated /

Docker-DCO-1.1-Signed-off-by: Djibril Koné <kone.djibril@gmail.com> (github: enokd)
Upstream-commit: e38e977a0410b754b6f318ff973dc15e6d756023
Component: engine
This commit is contained in:
Djibril Koné
2014-03-20 00:45:29 +01:00
parent 9f3a8a726d
commit 694ecbc3a5
+5
View File
@@ -1452,6 +1452,11 @@ func (cli *DockerCli) CmdCommit(args ...string) error {
return nil
}
re := regexp.MustCompile("/{2}")
if re.MatchString(repository) {
return fmt.Errorf("Error: Bad image name. Please rename your image in the format <user>/<repo>")
}
v := url.Values{}
v.Set("container", name)
v.Set("repo", repository)