mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Use correct type for ContainerExecAttach
ContainerExecAttach used `types.ExecConfig` instead of `types.ExecStartCheck`, which is the type that's expected by the `/exec/execid/start` API endpoint. Investigating when this inconsistency was introduced, I found that the client has sent the additional properties since its first imlpementation inc786a8ee5e
. The `postContainerExecStart()` at that time used the "jobs" package, which only took the information from the body that was needed (`Detach` and `Tty`). Commit24425021d2
refactored the Exec commands to remove the "jobs", and introduced the `ExecStartCheck` type, but failed to update the `cli.hijack()` call with the new type. The change in this patch should not affect compatibility with older clients, as the additional information from the `ExecConfig` type is not used (the API server already decodes to the `ExecStartCheck` type). Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
parent
2bc9bff867
commit
5fee8bddfe
2 changed files with 2 additions and 2 deletions
|
@ -35,7 +35,7 @@ func (cli *Client) ContainerExecStart(ctx context.Context, execID string, config
|
||||||
// It returns a types.HijackedConnection with the hijacked connection
|
// It returns a types.HijackedConnection with the hijacked connection
|
||||||
// and the a reader to get output. It's up to the called to close
|
// and the a reader to get output. It's up to the called to close
|
||||||
// the hijacked connection by calling types.HijackedResponse.Close.
|
// the hijacked connection by calling types.HijackedResponse.Close.
|
||||||
func (cli *Client) ContainerExecAttach(ctx context.Context, execID string, config types.ExecConfig) (types.HijackedResponse, error) {
|
func (cli *Client) ContainerExecAttach(ctx context.Context, execID string, config types.ExecStartCheck) (types.HijackedResponse, error) {
|
||||||
headers := map[string][]string{"Content-Type": {"application/json"}}
|
headers := map[string][]string{"Content-Type": {"application/json"}}
|
||||||
return cli.postHijacked(ctx, "/exec/"+execID+"/start", nil, config, headers)
|
return cli.postHijacked(ctx, "/exec/"+execID+"/start", nil, config, headers)
|
||||||
}
|
}
|
||||||
|
|
|
@ -45,7 +45,7 @@ type ContainerAPIClient interface {
|
||||||
ContainerCommit(ctx context.Context, container string, options types.ContainerCommitOptions) (types.IDResponse, error)
|
ContainerCommit(ctx context.Context, container string, options types.ContainerCommitOptions) (types.IDResponse, error)
|
||||||
ContainerCreate(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, containerName string) (container.ContainerCreateCreatedBody, error)
|
ContainerCreate(ctx context.Context, config *container.Config, hostConfig *container.HostConfig, networkingConfig *network.NetworkingConfig, containerName string) (container.ContainerCreateCreatedBody, error)
|
||||||
ContainerDiff(ctx context.Context, container string) ([]container.ContainerChangeResponseItem, error)
|
ContainerDiff(ctx context.Context, container string) ([]container.ContainerChangeResponseItem, error)
|
||||||
ContainerExecAttach(ctx context.Context, execID string, config types.ExecConfig) (types.HijackedResponse, error)
|
ContainerExecAttach(ctx context.Context, execID string, config types.ExecStartCheck) (types.HijackedResponse, error)
|
||||||
ContainerExecCreate(ctx context.Context, container string, config types.ExecConfig) (types.IDResponse, error)
|
ContainerExecCreate(ctx context.Context, container string, config types.ExecConfig) (types.IDResponse, error)
|
||||||
ContainerExecInspect(ctx context.Context, execID string) (types.ContainerExecInspect, error)
|
ContainerExecInspect(ctx context.Context, execID string) (types.ContainerExecInspect, error)
|
||||||
ContainerExecResize(ctx context.Context, execID string, options types.ResizeOptions) error
|
ContainerExecResize(ctx context.Context, execID string, options types.ResizeOptions) error
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue