api: return imageID instead of imageName, for "Image" when Podman API is queried

Signed-off-by: Josh Patterson <josh.patterson@securityonionsolutions.com>
This commit is contained in:
Josh Patterson 2022-08-17 11:26:17 -04:00
parent 3aa92010df
commit 6411f57e78
1 changed files with 2 additions and 2 deletions

View File

@ -407,7 +407,7 @@ func convertSecondaryIPPrefixLen(input *define.InspectNetworkSettings, output *t
}
func LibpodToContainerJSON(l *libpod.Container, sz bool) (*types.ContainerJSON, error) {
_, imageName := l.Image()
imageID, imageName := l.Image()
inspect, err := l.Inspect(sz)
if err != nil {
return nil, err
@ -487,7 +487,7 @@ func LibpodToContainerJSON(l *libpod.Container, sz bool) (*types.ContainerJSON,
Path: inspect.Path,
Args: inspect.Args,
State: &state,
Image: imageName,
Image: "sha256:" + imageID,
ResolvConfPath: inspect.ResolvConfPath,
HostnamePath: inspect.HostnamePath,
HostsPath: inspect.HostsPath,