Browse code

client: Rename ContainerUnPause* to ContainerUnpause*

To better match the method name itself

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>

Paweł Gronowski authored on 2025/10/29 19:32:32
Showing 8 changed files
... ...
@@ -74,7 +74,7 @@ type ContainerAPIClient interface {
74 74
 	ContainerStart(ctx context.Context, container string, options ContainerStartOptions) (ContainerStartResult, error)
75 75
 	ContainerStop(ctx context.Context, container string, options ContainerStopOptions) (ContainerStopResult, error)
76 76
 	ContainerTop(ctx context.Context, container string, options ContainerTopOptions) (ContainerTopResult, error)
77
-	ContainerUnpause(ctx context.Context, container string, options ContainerUnPauseOptions) (ContainerUnPauseResult, error)
77
+	ContainerUnpause(ctx context.Context, container string, options ContainerUnpauseOptions) (ContainerUnpauseResult, error)
78 78
 	ContainerUpdate(ctx context.Context, container string, updateConfig container.UpdateConfig) (container.UpdateResponse, error)
79 79
 	ContainerWait(ctx context.Context, container string, options ContainerWaitOptions) ContainerWaitResult
80 80
 	CopyFromContainer(ctx context.Context, container, srcPath string) (io.ReadCloser, container.PathStat, error)
... ...
@@ -2,27 +2,27 @@ package client
2 2
 
3 3
 import "context"
4 4
 
5
-// ContainerUnPauseOptions holds options for [Client.ContainerUnpause].
6
-type ContainerUnPauseOptions struct {
5
+// ContainerUnpauseOptions holds options for [Client.ContainerUnpause].
6
+type ContainerUnpauseOptions struct {
7 7
 	// Add future optional parameters here.
8 8
 }
9 9
 
10
-// ContainerUnPauseResult holds the result of [Client.ContainerUnpause],
11
-type ContainerUnPauseResult struct {
10
+// ContainerUnpauseResult holds the result of [Client.ContainerUnpause],
11
+type ContainerUnpauseResult struct {
12 12
 	// Add future fields here.
13 13
 }
14 14
 
15 15
 // ContainerUnpause resumes the process execution within a container.
16
-func (cli *Client) ContainerUnpause(ctx context.Context, containerID string, options ContainerUnPauseOptions) (ContainerUnPauseResult, error) {
16
+func (cli *Client) ContainerUnpause(ctx context.Context, containerID string, options ContainerUnpauseOptions) (ContainerUnpauseResult, error) {
17 17
 	containerID, err := trimID("container", containerID)
18 18
 	if err != nil {
19
-		return ContainerUnPauseResult{}, err
19
+		return ContainerUnpauseResult{}, err
20 20
 	}
21 21
 
22 22
 	resp, err := cli.post(ctx, "/containers/"+containerID+"/unpause", nil, nil, nil)
23 23
 	defer ensureReaderClosed(resp)
24 24
 	if err != nil {
25
-		return ContainerUnPauseResult{}, err
25
+		return ContainerUnpauseResult{}, err
26 26
 	}
27
-	return ContainerUnPauseResult{}, nil
27
+	return ContainerUnpauseResult{}, nil
28 28
 }
... ...
@@ -12,14 +12,14 @@ import (
12 12
 func TestContainerUnpauseError(t *testing.T) {
13 13
 	client, err := NewClientWithOpts(WithMockClient(errorMock(http.StatusInternalServerError, "Server error")))
14 14
 	assert.NilError(t, err)
15
-	_, err = client.ContainerUnpause(t.Context(), "nothing", ContainerUnPauseOptions{})
15
+	_, err = client.ContainerUnpause(t.Context(), "nothing", ContainerUnpauseOptions{})
16 16
 	assert.Check(t, is.ErrorType(err, cerrdefs.IsInternal))
17 17
 
18
-	_, err = client.ContainerUnpause(t.Context(), "", ContainerUnPauseOptions{})
18
+	_, err = client.ContainerUnpause(t.Context(), "", ContainerUnpauseOptions{})
19 19
 	assert.Check(t, is.ErrorType(err, cerrdefs.IsInvalidArgument))
20 20
 	assert.Check(t, is.ErrorContains(err, "value is empty"))
21 21
 
22
-	_, err = client.ContainerUnpause(t.Context(), "    ", ContainerUnPauseOptions{})
22
+	_, err = client.ContainerUnpause(t.Context(), "    ", ContainerUnpauseOptions{})
23 23
 	assert.Check(t, is.ErrorType(err, cerrdefs.IsInvalidArgument))
24 24
 	assert.Check(t, is.ErrorContains(err, "value is empty"))
25 25
 }
... ...
@@ -33,6 +33,6 @@ func TestContainerUnpause(t *testing.T) {
33 33
 		return mockResponse(http.StatusOK, nil, "")(req)
34 34
 	}))
35 35
 	assert.NilError(t, err)
36
-	_, err = client.ContainerUnpause(t.Context(), "container_id", ContainerUnPauseOptions{})
36
+	_, err = client.ContainerUnpause(t.Context(), "container_id", ContainerUnpauseOptions{})
37 37
 	assert.NilError(t, err)
38 38
 }
... ...
@@ -375,7 +375,7 @@ func (s *DockerAPISuite) TestContainerAPIPause(c *testing.T) {
375 375
 		c.Fatalf("there should be one paused container and not %d", len(pausedContainers))
376 376
 	}
377 377
 
378
-	_, err = apiClient.ContainerUnpause(testutil.GetContext(c), ContainerID, client.ContainerUnPauseOptions{})
378
+	_, err = apiClient.ContainerUnpause(testutil.GetContext(c), ContainerID, client.ContainerUnpauseOptions{})
379 379
 	assert.NilError(c, err)
380 380
 
381 381
 	pausedContainers = getPaused(c)
... ...
@@ -34,7 +34,7 @@ func TestPause(t *testing.T) {
34 34
 	assert.NilError(t, err)
35 35
 	assert.Check(t, is.Equal(true, inspect.Container.State.Paused))
36 36
 
37
-	_, err = apiClient.ContainerUnpause(ctx, cID, client.ContainerUnPauseOptions{})
37
+	_, err = apiClient.ContainerUnpause(ctx, cID, client.ContainerUnpauseOptions{})
38 38
 	assert.NilError(t, err)
39 39
 
40 40
 	until := request.DaemonUnixTime(ctx, t, apiClient, testEnv)
... ...
@@ -43,7 +43,7 @@ func unpauseAllContainers(ctx context.Context, t testing.TB, apiClient client.Co
43 43
 	containers := getPausedContainers(ctx, t, apiClient)
44 44
 	if len(containers) > 0 {
45 45
 		for _, ctr := range containers {
46
-			_, err := apiClient.ContainerUnpause(ctx, ctr.ID, client.ContainerUnPauseOptions{})
46
+			_, err := apiClient.ContainerUnpause(ctx, ctr.ID, client.ContainerUnpauseOptions{})
47 47
 			assert.Check(t, err, "failed to unpause container %s", ctr.ID)
48 48
 		}
49 49
 	}
... ...
@@ -74,7 +74,7 @@ type ContainerAPIClient interface {
74 74
 	ContainerStart(ctx context.Context, container string, options ContainerStartOptions) (ContainerStartResult, error)
75 75
 	ContainerStop(ctx context.Context, container string, options ContainerStopOptions) (ContainerStopResult, error)
76 76
 	ContainerTop(ctx context.Context, container string, options ContainerTopOptions) (ContainerTopResult, error)
77
-	ContainerUnpause(ctx context.Context, container string, options ContainerUnPauseOptions) (ContainerUnPauseResult, error)
77
+	ContainerUnpause(ctx context.Context, container string, options ContainerUnpauseOptions) (ContainerUnpauseResult, error)
78 78
 	ContainerUpdate(ctx context.Context, container string, updateConfig container.UpdateConfig) (container.UpdateResponse, error)
79 79
 	ContainerWait(ctx context.Context, container string, options ContainerWaitOptions) ContainerWaitResult
80 80
 	CopyFromContainer(ctx context.Context, container, srcPath string) (io.ReadCloser, container.PathStat, error)
... ...
@@ -2,27 +2,27 @@ package client
2 2
 
3 3
 import "context"
4 4
 
5
-// ContainerUnPauseOptions holds options for [Client.ContainerUnpause].
6
-type ContainerUnPauseOptions struct {
5
+// ContainerUnpauseOptions holds options for [Client.ContainerUnpause].
6
+type ContainerUnpauseOptions struct {
7 7
 	// Add future optional parameters here.
8 8
 }
9 9
 
10
-// ContainerUnPauseResult holds the result of [Client.ContainerUnpause],
11
-type ContainerUnPauseResult struct {
10
+// ContainerUnpauseResult holds the result of [Client.ContainerUnpause],
11
+type ContainerUnpauseResult struct {
12 12
 	// Add future fields here.
13 13
 }
14 14
 
15 15
 // ContainerUnpause resumes the process execution within a container.
16
-func (cli *Client) ContainerUnpause(ctx context.Context, containerID string, options ContainerUnPauseOptions) (ContainerUnPauseResult, error) {
16
+func (cli *Client) ContainerUnpause(ctx context.Context, containerID string, options ContainerUnpauseOptions) (ContainerUnpauseResult, error) {
17 17
 	containerID, err := trimID("container", containerID)
18 18
 	if err != nil {
19
-		return ContainerUnPauseResult{}, err
19
+		return ContainerUnpauseResult{}, err
20 20
 	}
21 21
 
22 22
 	resp, err := cli.post(ctx, "/containers/"+containerID+"/unpause", nil, nil, nil)
23 23
 	defer ensureReaderClosed(resp)
24 24
 	if err != nil {
25
-		return ContainerUnPauseResult{}, err
25
+		return ContainerUnpauseResult{}, err
26 26
 	}
27
-	return ContainerUnPauseResult{}, nil
27
+	return ContainerUnpauseResult{}, nil
28 28
 }