diff --git a/client/app/scripts/utils/web-api-utils.js b/client/app/scripts/utils/web-api-utils.js index 885adb271c..fd890ffe28 100644 --- a/client/app/scripts/utils/web-api-utils.js +++ b/client/app/scripts/utils/web-api-utils.js @@ -179,6 +179,7 @@ export function doControlRequest(nodeId, control) { clearTimeout(controlErrorTimer); const url = `api/control/${encodeURIComponent(control.probeId)}/` + `${encodeURIComponent(control.nodeId)}/${control.id}`; + const action = control.id; reqwest({ method: 'POST', url, @@ -188,7 +189,7 @@ export function doControlRequest(nodeId, control) { if (res.pipe) { receiveControlPipe(res.pipe, nodeId, res.raw_tty, true); } - if (res.removedNode) { + if (action === 'docker_remove_container') { receiveControlNodeRemoved(nodeId); } } diff --git a/common/xfer/controls.go b/common/xfer/controls.go index 244d70add2..2d5826aaf0 100644 --- a/common/xfer/controls.go +++ b/common/xfer/controls.go @@ -24,9 +24,6 @@ type Response struct { // Pipe specific fields Pipe string `json:"pipe,omitempty"` RawTTY bool `json:"raw_tty,omitempty"` - - // Remove specific fields - RemovedNode string `json:"removedNode,omitempty"` // Set if node was removed } // Message is the unions of Request, Response and arbitrary Value. diff --git a/probe/docker/controls.go b/probe/docker/controls.go index de2f4fe30f..edb3a476fb 100644 --- a/probe/docker/controls.go +++ b/probe/docker/controls.go @@ -51,14 +51,9 @@ func (r *registry) unpauseContainer(containerID string, _ xfer.Request) xfer.Res func (r *registry) removeContainer(containerID string, _ xfer.Request) xfer.Response { log.Infof("Removing container %s", containerID) - if err := r.client.RemoveContainer(docker_client.RemoveContainerOptions{ + return xfer.ResponseError(r.client.RemoveContainer(docker_client.RemoveContainerOptions{ ID: containerID, - }); err != nil { - return xfer.ResponseError(err) - } - return xfer.Response{ - RemovedNode: containerID, - } + })) } func (r *registry) attachContainer(containerID string, req xfer.Request) xfer.Response {