diff --git a/client/checkpoint_list.go b/client/checkpoint_list.go index 65a864aab2..5815f836a1 100644 --- a/client/checkpoint_list.go +++ b/client/checkpoint_list.go @@ -15,7 +15,7 @@ type CheckpointListOptions struct { // CheckpointListResult holds the result from the CheckpointList method. type CheckpointListResult struct { - Checkpoints []checkpoint.Summary + Items []checkpoint.Summary } // CheckpointList returns the checkpoints of the given container in the docker host. @@ -33,6 +33,6 @@ func (cli *Client) CheckpointList(ctx context.Context, container string, options return out, err } - err = json.NewDecoder(resp.Body).Decode(&out.Checkpoints) + err = json.NewDecoder(resp.Body).Decode(&out.Items) return out, err } diff --git a/client/checkpoint_list_test.go b/client/checkpoint_list_test.go index 00343ef363..8f899eed7c 100644 --- a/client/checkpoint_list_test.go +++ b/client/checkpoint_list_test.go @@ -1,7 +1,6 @@ package client import ( - "context" "net/http" "testing" @@ -17,7 +16,7 @@ func TestCheckpointListError(t *testing.T) { ) assert.NilError(t, err) - _, err = client.CheckpointList(context.Background(), "container_id", CheckpointListOptions{}) + _, err = client.CheckpointList(t.Context(), "container_id", CheckpointListOptions{}) assert.Check(t, is.ErrorType(err, cerrdefs.IsInternal)) } @@ -36,9 +35,9 @@ func TestCheckpointList(t *testing.T) { ) assert.NilError(t, err) - res, err := client.CheckpointList(context.Background(), "container_id", CheckpointListOptions{}) + res, err := client.CheckpointList(t.Context(), "container_id", CheckpointListOptions{}) assert.NilError(t, err) - assert.Check(t, is.Len(res.Checkpoints, 1)) + assert.Check(t, is.Len(res.Items, 1)) } func TestCheckpointListContainerNotFound(t *testing.T) { @@ -47,6 +46,6 @@ func TestCheckpointListContainerNotFound(t *testing.T) { ) assert.NilError(t, err) - _, err = client.CheckpointList(context.Background(), "unknown", CheckpointListOptions{}) + _, err = client.CheckpointList(t.Context(), "unknown", CheckpointListOptions{}) assert.Check(t, is.ErrorType(err, cerrdefs.IsNotFound)) } diff --git a/integration/container/checkpoint_test.go b/integration/container/checkpoint_test.go index 7df9d646ce..80a29fda51 100644 --- a/integration/container/checkpoint_test.go +++ b/integration/container/checkpoint_test.go @@ -79,8 +79,8 @@ func TestCheckpoint(t *testing.T) { res, err := apiClient.CheckpointList(ctx, cID, client.CheckpointListOptions{}) assert.NilError(t, err) - assert.Equal(t, len(res.Checkpoints), 1) - assert.Equal(t, res.Checkpoints[0].Name, "test") + assert.Equal(t, len(res.Items), 1) + assert.Equal(t, res.Items[0].Name, "test") // Create a test file on a tmpfs mount. cmd := []string{"touch", "/tmp/test-file"} @@ -105,9 +105,9 @@ func TestCheckpoint(t *testing.T) { // Check that both checkpoints are listed. res, err = apiClient.CheckpointList(ctx, cID, client.CheckpointListOptions{}) assert.NilError(t, err) - assert.Equal(t, len(res.Checkpoints), 2) + assert.Equal(t, len(res.Items), 2) cptNames := make([]string, 2) - for i, c := range res.Checkpoints { + for i, c := range res.Items { cptNames[i] = c.Name } sort.Strings(cptNames) diff --git a/vendor/github.com/moby/moby/client/checkpoint_list.go b/vendor/github.com/moby/moby/client/checkpoint_list.go index 65a864aab2..5815f836a1 100644 --- a/vendor/github.com/moby/moby/client/checkpoint_list.go +++ b/vendor/github.com/moby/moby/client/checkpoint_list.go @@ -15,7 +15,7 @@ type CheckpointListOptions struct { // CheckpointListResult holds the result from the CheckpointList method. type CheckpointListResult struct { - Checkpoints []checkpoint.Summary + Items []checkpoint.Summary } // CheckpointList returns the checkpoints of the given container in the docker host. @@ -33,6 +33,6 @@ func (cli *Client) CheckpointList(ctx context.Context, container string, options return out, err } - err = json.NewDecoder(resp.Body).Decode(&out.Checkpoints) + err = json.NewDecoder(resp.Body).Decode(&out.Items) return out, err }