From bc4160be3869f96b701f2e7bff8579be5be2b085 Mon Sep 17 00:00:00 2001 From: Toshiaki Makita Date: Tue, 8 Sep 2015 21:22:29 +0900 Subject: [PATCH] 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 --- libnetwork/client/service.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libnetwork/client/service.go b/libnetwork/client/service.go index 6b8fa15c7b..7fe82f6612 100644 --- a/libnetwork/client/service.go +++ b/libnetwork/client/service.go @@ -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 }