api/types/container: merge InspectResponse and ContainerJSONBase

Merge the two types instead of embedding the ContainerJSONBase.
This should have no impact on the API response, but users constructing
a response through struct literals will need to update their code.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
Sebastiaan van Stijn
2025-08-26 14:04:26 +02:00
parent 835afb123a
commit fae54e03af
6 changed files with 19 additions and 48 deletions

View File

@@ -86,16 +86,15 @@ func (daemon *Daemon) ContainerInspect(ctx context.Context, name string, options
imageManifest.Platform = &ctr.ImagePlatform
}
return &containertypes.InspectResponse{
ContainerJSONBase: base,
Mounts: mountPoints,
Config: ctr.Config,
NetworkSettings: networkSettings,
ImageManifestDescriptor: imageManifest,
}, nil
base.Mounts = mountPoints
base.Config = ctr.Config
base.NetworkSettings = networkSettings
base.ImageManifestDescriptor = imageManifest
return base, nil
}
func (daemon *Daemon) getInspectData(daemonCfg *config.Config, ctr *container.Container) (*containertypes.ContainerJSONBase, error) {
func (daemon *Daemon) getInspectData(daemonCfg *config.Config, ctr *container.Container) (*containertypes.InspectResponse, error) {
// make a copy to play with
hostConfig := *ctr.HostConfig
@@ -130,7 +129,7 @@ func (daemon *Daemon) getInspectData(daemonCfg *config.Config, ctr *container.Co
}
}
inspectResponse := &containertypes.ContainerJSONBase{
inspectResponse := &containertypes.InspectResponse{
ID: ctr.ID,
Created: ctr.Created.Format(time.RFC3339Nano),
Path: ctr.Path,