Merge pull request #36144 from emil2k/node-id-required

Produce errors when empty ids are passed into inspect calls.
This commit is contained in:
Tõnis Tiigi
2018-02-16 10:18:47 -08:00
committed by GitHub
22 changed files with 181 additions and 15 deletions

View File

@@ -11,6 +11,9 @@ import (
// TaskInspectWithRaw returns the task information and its raw representation..
func (cli *Client) TaskInspectWithRaw(ctx context.Context, taskID string) (swarm.Task, []byte, error) {
if taskID == "" {
return swarm.Task{}, nil, objectNotFoundError{object: "task", id: taskID}
}
serverResp, err := cli.get(ctx, "/tasks/"+taskID, nil, nil)
if err != nil {
return swarm.Task{}, nil, wrapResponseError(err, serverResp, "task", taskID)