mirror of
https://github.com/docker/cli.git
synced 2026-09-25 17:02:07 -04:00
fix docker rm name issue
Addresses https://github.com/docker/docker/issues/12308 Signed-off-by: Qiang Huang <h.huangqiang@huawei.com> Upstream-commit: 79f13d1497b073113f713e903e934dafcf78c42f Component: engine
This commit is contained in:
@@ -3,6 +3,7 @@ package client
|
||||
import (
|
||||
"fmt"
|
||||
"net/url"
|
||||
"strings"
|
||||
|
||||
flag "github.com/docker/docker/pkg/mflag"
|
||||
)
|
||||
@@ -36,6 +37,7 @@ func (cli *DockerCli) CmdRm(args ...string) error {
|
||||
if name == "" {
|
||||
return fmt.Errorf("Container name cannot be empty")
|
||||
}
|
||||
name = strings.Trim(name, "/")
|
||||
|
||||
_, _, err := readBody(cli.call("DELETE", "/containers/"+name+"?"+val.Encode(), nil, nil))
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user