api/types/container: introduce ExecCreateResponse type

Introduce a container.ExecCreateResponse type as alias for IDResponse to allow
consumers to use ContainerCommit without having to import the "types" package,
and allows us to differentiate the response for container commit separate from
other endpoints currently using IDResponse.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2025-02-10 19:44:33 +01:00
parent 0df3a0047a
commit 9a20edf7b6
5 changed files with 17 additions and 10 deletions

View File

@@ -10,7 +10,6 @@ import (
"strings"
"testing"
"github.com/docker/docker/api/types"
"github.com/docker/docker/api/types/container"
"github.com/docker/docker/errdefs"
"gotest.tools/v3/assert"
@@ -67,7 +66,7 @@ func TestContainerExecCreate(t *testing.T) {
if execConfig.User != "user" {
return nil, fmt.Errorf("expected an execConfig with User == 'user', got %v", execConfig)
}
b, err := json.Marshal(types.IDResponse{
b, err := json.Marshal(container.ExecCreateResponse{
ID: "exec_id",
})
if err != nil {