mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
client: Rename ContainerUnPause* to ContainerUnpause*
To better match the method name itself Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
This commit is contained in:
@@ -74,7 +74,7 @@ type ContainerAPIClient interface {
|
|||||||
ContainerStart(ctx context.Context, container string, options ContainerStartOptions) (ContainerStartResult, error)
|
ContainerStart(ctx context.Context, container string, options ContainerStartOptions) (ContainerStartResult, error)
|
||||||
ContainerStop(ctx context.Context, container string, options ContainerStopOptions) (ContainerStopResult, error)
|
ContainerStop(ctx context.Context, container string, options ContainerStopOptions) (ContainerStopResult, error)
|
||||||
ContainerTop(ctx context.Context, container string, options ContainerTopOptions) (ContainerTopResult, error)
|
ContainerTop(ctx context.Context, container string, options ContainerTopOptions) (ContainerTopResult, error)
|
||||||
ContainerUnpause(ctx context.Context, container string, options ContainerUnPauseOptions) (ContainerUnPauseResult, error)
|
ContainerUnpause(ctx context.Context, container string, options ContainerUnpauseOptions) (ContainerUnpauseResult, error)
|
||||||
ContainerUpdate(ctx context.Context, container string, updateConfig container.UpdateConfig) (container.UpdateResponse, error)
|
ContainerUpdate(ctx context.Context, container string, updateConfig container.UpdateConfig) (container.UpdateResponse, error)
|
||||||
ContainerWait(ctx context.Context, container string, options ContainerWaitOptions) ContainerWaitResult
|
ContainerWait(ctx context.Context, container string, options ContainerWaitOptions) ContainerWaitResult
|
||||||
CopyFromContainer(ctx context.Context, container, srcPath string) (io.ReadCloser, container.PathStat, error)
|
CopyFromContainer(ctx context.Context, container, srcPath string) (io.ReadCloser, container.PathStat, error)
|
||||||
|
|||||||
@@ -2,27 +2,27 @@ package client
|
|||||||
|
|
||||||
import "context"
|
import "context"
|
||||||
|
|
||||||
// ContainerUnPauseOptions holds options for [Client.ContainerUnpause].
|
// ContainerUnpauseOptions holds options for [Client.ContainerUnpause].
|
||||||
type ContainerUnPauseOptions struct {
|
type ContainerUnpauseOptions struct {
|
||||||
// Add future optional parameters here.
|
// Add future optional parameters here.
|
||||||
}
|
}
|
||||||
|
|
||||||
// ContainerUnPauseResult holds the result of [Client.ContainerUnpause],
|
// ContainerUnpauseResult holds the result of [Client.ContainerUnpause],
|
||||||
type ContainerUnPauseResult struct {
|
type ContainerUnpauseResult struct {
|
||||||
// Add future fields here.
|
// Add future fields here.
|
||||||
}
|
}
|
||||||
|
|
||||||
// ContainerUnpause resumes the process execution within a container.
|
// ContainerUnpause resumes the process execution within a container.
|
||||||
func (cli *Client) ContainerUnpause(ctx context.Context, containerID string, options ContainerUnPauseOptions) (ContainerUnPauseResult, error) {
|
func (cli *Client) ContainerUnpause(ctx context.Context, containerID string, options ContainerUnpauseOptions) (ContainerUnpauseResult, error) {
|
||||||
containerID, err := trimID("container", containerID)
|
containerID, err := trimID("container", containerID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return ContainerUnPauseResult{}, err
|
return ContainerUnpauseResult{}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := cli.post(ctx, "/containers/"+containerID+"/unpause", nil, nil, nil)
|
resp, err := cli.post(ctx, "/containers/"+containerID+"/unpause", nil, nil, nil)
|
||||||
defer ensureReaderClosed(resp)
|
defer ensureReaderClosed(resp)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return ContainerUnPauseResult{}, err
|
return ContainerUnpauseResult{}, err
|
||||||
}
|
}
|
||||||
return ContainerUnPauseResult{}, nil
|
return ContainerUnpauseResult{}, nil
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,14 +12,14 @@ import (
|
|||||||
func TestContainerUnpauseError(t *testing.T) {
|
func TestContainerUnpauseError(t *testing.T) {
|
||||||
client, err := NewClientWithOpts(WithMockClient(errorMock(http.StatusInternalServerError, "Server error")))
|
client, err := NewClientWithOpts(WithMockClient(errorMock(http.StatusInternalServerError, "Server error")))
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
_, err = client.ContainerUnpause(t.Context(), "nothing", ContainerUnPauseOptions{})
|
_, err = client.ContainerUnpause(t.Context(), "nothing", ContainerUnpauseOptions{})
|
||||||
assert.Check(t, is.ErrorType(err, cerrdefs.IsInternal))
|
assert.Check(t, is.ErrorType(err, cerrdefs.IsInternal))
|
||||||
|
|
||||||
_, err = client.ContainerUnpause(t.Context(), "", ContainerUnPauseOptions{})
|
_, err = client.ContainerUnpause(t.Context(), "", ContainerUnpauseOptions{})
|
||||||
assert.Check(t, is.ErrorType(err, cerrdefs.IsInvalidArgument))
|
assert.Check(t, is.ErrorType(err, cerrdefs.IsInvalidArgument))
|
||||||
assert.Check(t, is.ErrorContains(err, "value is empty"))
|
assert.Check(t, is.ErrorContains(err, "value is empty"))
|
||||||
|
|
||||||
_, err = client.ContainerUnpause(t.Context(), " ", ContainerUnPauseOptions{})
|
_, err = client.ContainerUnpause(t.Context(), " ", ContainerUnpauseOptions{})
|
||||||
assert.Check(t, is.ErrorType(err, cerrdefs.IsInvalidArgument))
|
assert.Check(t, is.ErrorType(err, cerrdefs.IsInvalidArgument))
|
||||||
assert.Check(t, is.ErrorContains(err, "value is empty"))
|
assert.Check(t, is.ErrorContains(err, "value is empty"))
|
||||||
}
|
}
|
||||||
@@ -33,6 +33,6 @@ func TestContainerUnpause(t *testing.T) {
|
|||||||
return mockResponse(http.StatusOK, nil, "")(req)
|
return mockResponse(http.StatusOK, nil, "")(req)
|
||||||
}))
|
}))
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
_, err = client.ContainerUnpause(t.Context(), "container_id", ContainerUnPauseOptions{})
|
_, err = client.ContainerUnpause(t.Context(), "container_id", ContainerUnpauseOptions{})
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -375,7 +375,7 @@ func (s *DockerAPISuite) TestContainerAPIPause(c *testing.T) {
|
|||||||
c.Fatalf("there should be one paused container and not %d", len(pausedContainers))
|
c.Fatalf("there should be one paused container and not %d", len(pausedContainers))
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = apiClient.ContainerUnpause(testutil.GetContext(c), ContainerID, client.ContainerUnPauseOptions{})
|
_, err = apiClient.ContainerUnpause(testutil.GetContext(c), ContainerID, client.ContainerUnpauseOptions{})
|
||||||
assert.NilError(c, err)
|
assert.NilError(c, err)
|
||||||
|
|
||||||
pausedContainers = getPaused(c)
|
pausedContainers = getPaused(c)
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ func TestPause(t *testing.T) {
|
|||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
assert.Check(t, is.Equal(true, inspect.Container.State.Paused))
|
assert.Check(t, is.Equal(true, inspect.Container.State.Paused))
|
||||||
|
|
||||||
_, err = apiClient.ContainerUnpause(ctx, cID, client.ContainerUnPauseOptions{})
|
_, err = apiClient.ContainerUnpause(ctx, cID, client.ContainerUnpauseOptions{})
|
||||||
assert.NilError(t, err)
|
assert.NilError(t, err)
|
||||||
|
|
||||||
until := request.DaemonUnixTime(ctx, t, apiClient, testEnv)
|
until := request.DaemonUnixTime(ctx, t, apiClient, testEnv)
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ func unpauseAllContainers(ctx context.Context, t testing.TB, apiClient client.Co
|
|||||||
containers := getPausedContainers(ctx, t, apiClient)
|
containers := getPausedContainers(ctx, t, apiClient)
|
||||||
if len(containers) > 0 {
|
if len(containers) > 0 {
|
||||||
for _, ctr := range containers {
|
for _, ctr := range containers {
|
||||||
_, err := apiClient.ContainerUnpause(ctx, ctr.ID, client.ContainerUnPauseOptions{})
|
_, err := apiClient.ContainerUnpause(ctx, ctr.ID, client.ContainerUnpauseOptions{})
|
||||||
assert.Check(t, err, "failed to unpause container %s", ctr.ID)
|
assert.Check(t, err, "failed to unpause container %s", ctr.ID)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
2
vendor/github.com/moby/moby/client/client_interfaces.go
generated
vendored
2
vendor/github.com/moby/moby/client/client_interfaces.go
generated
vendored
@@ -74,7 +74,7 @@ type ContainerAPIClient interface {
|
|||||||
ContainerStart(ctx context.Context, container string, options ContainerStartOptions) (ContainerStartResult, error)
|
ContainerStart(ctx context.Context, container string, options ContainerStartOptions) (ContainerStartResult, error)
|
||||||
ContainerStop(ctx context.Context, container string, options ContainerStopOptions) (ContainerStopResult, error)
|
ContainerStop(ctx context.Context, container string, options ContainerStopOptions) (ContainerStopResult, error)
|
||||||
ContainerTop(ctx context.Context, container string, options ContainerTopOptions) (ContainerTopResult, error)
|
ContainerTop(ctx context.Context, container string, options ContainerTopOptions) (ContainerTopResult, error)
|
||||||
ContainerUnpause(ctx context.Context, container string, options ContainerUnPauseOptions) (ContainerUnPauseResult, error)
|
ContainerUnpause(ctx context.Context, container string, options ContainerUnpauseOptions) (ContainerUnpauseResult, error)
|
||||||
ContainerUpdate(ctx context.Context, container string, updateConfig container.UpdateConfig) (container.UpdateResponse, error)
|
ContainerUpdate(ctx context.Context, container string, updateConfig container.UpdateConfig) (container.UpdateResponse, error)
|
||||||
ContainerWait(ctx context.Context, container string, options ContainerWaitOptions) ContainerWaitResult
|
ContainerWait(ctx context.Context, container string, options ContainerWaitOptions) ContainerWaitResult
|
||||||
CopyFromContainer(ctx context.Context, container, srcPath string) (io.ReadCloser, container.PathStat, error)
|
CopyFromContainer(ctx context.Context, container, srcPath string) (io.ReadCloser, container.PathStat, error)
|
||||||
|
|||||||
16
vendor/github.com/moby/moby/client/container_unpause.go
generated
vendored
16
vendor/github.com/moby/moby/client/container_unpause.go
generated
vendored
@@ -2,27 +2,27 @@ package client
|
|||||||
|
|
||||||
import "context"
|
import "context"
|
||||||
|
|
||||||
// ContainerUnPauseOptions holds options for [Client.ContainerUnpause].
|
// ContainerUnpauseOptions holds options for [Client.ContainerUnpause].
|
||||||
type ContainerUnPauseOptions struct {
|
type ContainerUnpauseOptions struct {
|
||||||
// Add future optional parameters here.
|
// Add future optional parameters here.
|
||||||
}
|
}
|
||||||
|
|
||||||
// ContainerUnPauseResult holds the result of [Client.ContainerUnpause],
|
// ContainerUnpauseResult holds the result of [Client.ContainerUnpause],
|
||||||
type ContainerUnPauseResult struct {
|
type ContainerUnpauseResult struct {
|
||||||
// Add future fields here.
|
// Add future fields here.
|
||||||
}
|
}
|
||||||
|
|
||||||
// ContainerUnpause resumes the process execution within a container.
|
// ContainerUnpause resumes the process execution within a container.
|
||||||
func (cli *Client) ContainerUnpause(ctx context.Context, containerID string, options ContainerUnPauseOptions) (ContainerUnPauseResult, error) {
|
func (cli *Client) ContainerUnpause(ctx context.Context, containerID string, options ContainerUnpauseOptions) (ContainerUnpauseResult, error) {
|
||||||
containerID, err := trimID("container", containerID)
|
containerID, err := trimID("container", containerID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return ContainerUnPauseResult{}, err
|
return ContainerUnpauseResult{}, err
|
||||||
}
|
}
|
||||||
|
|
||||||
resp, err := cli.post(ctx, "/containers/"+containerID+"/unpause", nil, nil, nil)
|
resp, err := cli.post(ctx, "/containers/"+containerID+"/unpause", nil, nil, nil)
|
||||||
defer ensureReaderClosed(resp)
|
defer ensureReaderClosed(resp)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return ContainerUnPauseResult{}, err
|
return ContainerUnpauseResult{}, err
|
||||||
}
|
}
|
||||||
return ContainerUnPauseResult{}, nil
|
return ContainerUnpauseResult{}, nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user