Skip to content

client, api: Many types in api/types do not relate to the Engine API #50740

@corhere

Description

@corhere

Description

There are several types and other definitions in api/types/... which are out of scope of the Engine API. These are primarily struct types which are referenced by the client and/or daemon, but are not marshaled or unmarshaled. These types should be moved out of the API module before we stabilize it.

Client and/or daemon machinery

  • types.HijackedResponse

Daemon internals

  • Disk-usage structs passed from daemon to the API-server handler but not marshaled
    • build.DiskUsage
    • container.DiskUsage
    • image.DiskUsage
    • volume.DiskUsage
  • Registry auth decoders
    • registry.DecodeAuthConfig()
    • registry.DecodeAuthConfigBody()

Options types

These types are consumed by the client to either control client behaviour or fill in GET query parameters for the API call. In some cases the daemon API-server handlers reconstruct the structs from the GET parameters. Some of the structs contain non-serializable func and interface (e.g. io.Reader) fields. None of them describe the shape of Engine API requests or responses in any way that would be useful to consumers of the api module without the client module.

  • Build Options
    • build.CachePruneOptions
    • build.ImageBuildOptions - used to get/set query args: split to client and backend
    • build.ImageBuildOutput - used as field for the above: split to client and backend
    • build.ImageBuildResponse - is not a response, but constructed by client. move to client, and remove eventually
  • Checkpoint options
    • CreateOptions - duplicate to CreateRequest (api) and CreateOptions in client
    • ListOptions - also duplicate to backend
    • DeleteOptions - also duplicate to backend
  • Every definition in api/types/container/options.go, and some other options:
    • container.ResizeOptions
    • container.AttachOptions
    • container.CommitOptions
    • container.CopyToContainerOptions
    • container.RemoveOptions
    • container.StartOptions
    • container.LogsOptions (needs to be duplicated client + backend)
    • container.ListOptions
    • container.LogsOptions
  • Container exec options
    • container.ExecCreateResponse consider making this a concrete type instead of an alias
    • container.ExecOptions split / duplicate to client.ExecCreateOptions and container.ExecCreateRequest
    • container.ExecStartOptions ditto
    • container.ExecAttachOptions ditto
    • container.ExecInspect move to client, but explicitly map to ExecInspectResponse
    • container.ExecInspectResponse consider merging fields into the above (i.e., don't discard fields?)
  • events.ListOptions
    • image.ImportSource -- has an io.Reader field
    • image.ImportOptions
    • image.CreateOptions
    • image.PullOptions -- func field
    • image.PushOptions -- func field
    • image.ListOptions
    • image.RemoveOptions
    • image.HistoryOptions -- client sets it with functional options
    • image.LoadOptions -- ditto
    • image.InspectOptions -- ditto
    • image.SaveOptions -- ditto
    • image. LoadResponse is not a response, but a wrapper used by the client
  • Network options
    • network.ListOptions
    • network.InspectOptions
    • network.CreateOptions
    • network.ConnectOptions
    • network.DisconnectOptions
  • registry.SearchOptions -- func field
  • Swarm options
    • swarm.ConfigListOptions
    • swarm.NodeListOptions
    • swarm.NodeRemoveOptions
    • swarm.ServiceCreateOptions
    • swarm.ServiceUpdateOptions
    • swarm.ServiceListOptions
    • swarm.ServiceInspectOptions
    • swarm.UpdateFlags
    • swarm.TaskListOptions
    • swarm.SecretListOptions
  • system.DiskUsageOptions
  • system.SecurityOpt
    • system.DecodeSecurityOptions()
  • volume.ListOptions

Misc

  • registry.EncodeAuthConfig() -- not used anywhere?
  • registry.ServiceConfig.MarshalJSON() -- legacy?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions