mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
client: merge ExecInspectResult with ExecInspect
The `ExecInspectResult` type was embedding `ExecInspect`, which is also defined by the client, so there's no need to abstract it. While updating, also; - Rename `ExecID` to `ID`, to match the field-name returned by the API. - Rename `Pid` to `PID`, to be in the right casing. - Remove `json` labels, as option-types are not (un)marshaled to JSON. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -77,12 +77,12 @@ func Exec(ctx context.Context, apiClient client.APIClient, id string, cmd []stri
|
||||
}
|
||||
|
||||
// get the exit code
|
||||
iresp, err := apiClient.ExecInspect(ctx, execID, client.ExecInspectOptions{})
|
||||
inspect, err := apiClient.ExecInspect(ctx, execID, client.ExecInspectOptions{})
|
||||
if err != nil {
|
||||
return ExecResult{}, err
|
||||
}
|
||||
|
||||
return ExecResult{ExitCode: iresp.ExitCode, outBuffer: &s.stdout, errBuffer: &s.stderr}, nil
|
||||
return ExecResult{ExitCode: inspect.ExitCode, outBuffer: &s.stdout, errBuffer: &s.stderr}, nil
|
||||
}
|
||||
|
||||
// ExecT calls Exec() and aborts the test if an error occurs.
|
||||
|
||||
Reference in New Issue
Block a user