Skip to content
This repository has been archived by the owner on Mar 18, 2024. It is now read-only.

add result response ExecStart #243

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions dockerclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -355,18 +355,19 @@ func (client *DockerClient) ExecCreate(config *ExecConfig) (string, error) {
return createExecResp.Id, nil
}

func (client *DockerClient) ExecStart(id string, config *ExecConfig) error {
func (client *DockerClient) ExecStart(id string, config *ExecConfig) (string, error) {
data, err := json.Marshal(config)
if err != nil {
return err
return "",err
}

uri := fmt.Sprintf("/%s/exec/%s/start", APIVersion, id)
if _, err := client.doRequest("POST", uri, data, nil); err != nil {
return err
result, err := client.doRequest("POST", uri, data, nil)
if err != nil {
return "",err
}

return nil
return string(result), nil
}

func (client *DockerClient) ExecResize(id string, width, height int) error {
Expand Down
2 changes: 1 addition & 1 deletion interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type Client interface {
// closed.
ContainerStats(id string, stopChan <-chan struct{}) (<-chan StatsOrError, error)
ExecCreate(config *ExecConfig) (string, error)
ExecStart(id string, config *ExecConfig) error
ExecStart(id string, config *ExecConfig) (string,error)
ExecResize(id string, width, height int) error
StartContainer(id string, config *HostConfig) error
AttachContainer(id string, options *AttachOptions) (io.ReadCloser, error)
Expand Down