daemon/server/backend: remove ExecInspect, ExecProcessConfig alias

Type type was defined before the API had a definition fro the exec-inspect
response. When a type definition was added in [moby@2a34207], the definition
was moved from the backend to the API, and the backend type implemented as
an alias.

Technically, we could keep a _concrete_ type for the backend, and handle
conversion to the corresponding API type in the router, but currently,
this would likely only add extra complexity.

We could still opt for doing so when the backend requires additional fields
or changes that should not be reflected in the API response.

[moby@2a34207]: 2a342079c6

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2025-09-16 17:59:02 +02:00
parent da5ca1b746
commit 2a867f0c4d
3 changed files with 4 additions and 12 deletions

View File

@@ -184,7 +184,7 @@ func (daemon *Daemon) getInspectData(daemonCfg *config.Config, ctr *container.Co
// ContainerExecInspect returns low-level information about the exec
// command. An error is returned if the exec cannot be found.
func (daemon *Daemon) ContainerExecInspect(id string) (*backend.ExecInspect, error) {
func (daemon *Daemon) ContainerExecInspect(id string) (*containertypes.ExecInspectResponse, error) {
e := daemon.execCommands.Get(id)
if e == nil {
return nil, errExecNotFound(id)
@@ -209,11 +209,11 @@ func (daemon *Daemon) ContainerExecInspect(id string) (*backend.ExecInspect, err
privileged = &e.Privileged
}
return &backend.ExecInspect{
return &containertypes.ExecInspectResponse{
ID: e.ID,
Running: e.Running,
ExitCode: e.ExitCode,
ProcessConfig: &backend.ExecProcessConfig{
ProcessConfig: &containertypes.ExecProcessConfig{
Tty: e.Tty,
Entrypoint: e.Entrypoint,
Arguments: e.Args,

View File

@@ -149,14 +149,6 @@ type ExecStartConfig struct {
ConsoleSize *[2]uint `json:",omitempty"`
}
// ExecInspect holds information about a running process started
// with docker exec.
type ExecInspect = container.ExecInspectResponse
// ExecProcessConfig holds information about the exec process
// running on the host.
type ExecProcessConfig = container.ExecProcessConfig
// CreateImageConfig is the configuration for creating an image from a
// container.
type CreateImageConfig struct {

View File

@@ -15,7 +15,7 @@ import (
// execBackend includes functions to implement to provide exec functionality.
type execBackend interface {
ContainerExecCreate(name string, options *container.ExecCreateRequest) (string, error)
ContainerExecInspect(id string) (*backend.ExecInspect, error)
ContainerExecInspect(id string) (*container.ExecInspectResponse, error)
ContainerExecResize(ctx context.Context, name string, height, width uint32) error
ContainerExecStart(ctx context.Context, name string, options backend.ExecStartConfig) error
ExecExists(name string) (bool, error)