mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Fix inability to detach service
CmdServiceDetach() incorrectly uses containerID where sandboxID is expected. Thus, procDeleteSandbox() fails to find the corresponding sandbox and returns the "Resource not found" error. Signed-off-by: Toshiaki Makita <makita.toshiaki@lab.ntt.co.jp>
This commit is contained in:
parent
81dc07fb11
commit
bc4160be38
1 changed files with 6 additions and 1 deletions
|
@ -360,12 +360,17 @@ func (cli *NetworkCli) CmdServiceDetach(chain string, args ...string) error {
|
|||
return err
|
||||
}
|
||||
|
||||
sandboxID, err := lookupSandboxID(cli, containerID)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
serviceID, err := lookupServiceID(cli, nn, sn)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
_, _, err = readBody(cli.call("DELETE", "/services/"+serviceID+"/backend/"+containerID, nil, nil))
|
||||
_, _, err = readBody(cli.call("DELETE", "/services/"+serviceID+"/backend/"+sandboxID, nil, nil))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue