mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Fix commit and import when no repository is specified
Docker-DCO-1.1-Signed-off-by: Michael Crosby <michael@crosbymichael.com> (github: crosbymichael)
This commit is contained in:
parent
45b43d85ec
commit
097aef2ca9
1 changed files with 9 additions and 5 deletions
|
@ -1013,9 +1013,11 @@ func (cli *DockerCli) CmdImport(args ...string) error {
|
|||
}
|
||||
v := url.Values{}
|
||||
|
||||
//Check if the given image name can be resolved
|
||||
if _, _, err := registry.ResolveRepositoryName(repository); err != nil {
|
||||
return err
|
||||
if repository != "" {
|
||||
//Check if the given image name can be resolved
|
||||
if _, _, err := registry.ResolveRepositoryName(repository); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
v.Set("repo", repository)
|
||||
|
@ -1469,8 +1471,10 @@ func (cli *DockerCli) CmdCommit(args ...string) error {
|
|||
}
|
||||
|
||||
//Check if the given image name can be resolved
|
||||
if _, _, err := registry.ResolveRepositoryName(repository); err != nil {
|
||||
return err
|
||||
if repository != "" {
|
||||
if _, _, err := registry.ResolveRepositoryName(repository); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
v := url.Values{}
|
||||
|
|
Loading…
Reference in a new issue