diff --git a/common/xfer/controls.go b/common/xfer/controls.go index 49a0f35ad..d1fd19c23 100644 --- a/common/xfer/controls.go +++ b/common/xfer/controls.go @@ -18,10 +18,14 @@ type Request struct { // Response is the Probe -> App -> UI message type for the control RPCs. type Response struct { - Value interface{} `json:"value,omitempty"` - Error string `json:"error,omitempty"` - Pipe string `json:"pipe,omitempty"` - RawTTY bool `json:"raw_tty,omitempty"` + Value interface{} `json:"value,omitempty"` + Error string `json:"error,omitempty"` + + // Pipe specific fields + Pipe string `json:"pipe,omitempty"` + RawTTY bool `json:"raw_tty,omitempty"` + + CloseDetails bool `json:"closeDetails,omitempty"` // True will cause the UI to close the details panel. } // Message is the unions of Request, Response and arbitrary Value. diff --git a/probe/docker/controls.go b/probe/docker/controls.go index edb3a476f..1748710b4 100644 --- a/probe/docker/controls.go +++ b/probe/docker/controls.go @@ -51,9 +51,14 @@ 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) - return xfer.ResponseError(r.client.RemoveContainer(docker_client.RemoveContainerOptions{ + if err := r.client.RemoveContainer(docker_client.RemoveContainerOptions{ ID: containerID, - })) + }); err != nil { + return xfer.ResponseError(err) + } + return xfer.Response{ + CloseDetails: true, + } } func (r *registry) attachContainer(containerID string, req xfer.Request) xfer.Response {