mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user