summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Patterson <josh.patterson@securityonionsolutions.com>2022-08-17 11:26:17 -0400
committerMatthew Heon <mheon@redhat.com>2022-09-06 14:55:16 -0400
commit54a9e24488a455e8b338d49719bc1c514697445e (patch)
treea4962aaf00c51b1e733a4252ba74a802236ecab5
parentecfbc6f3247448df8c297dca8c32ce7aea18656a (diff)
downloadpodman-54a9e24488a455e8b338d49719bc1c514697445e.tar.gz
podman-54a9e24488a455e8b338d49719bc1c514697445e.tar.bz2
podman-54a9e24488a455e8b338d49719bc1c514697445e.zip
api: return imageID instead of imageName, for "Image" when Podman API is queried
Signed-off-by: Josh Patterson <josh.patterson@securityonionsolutions.com>
-rw-r--r--pkg/api/handlers/compat/containers.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/api/handlers/compat/containers.go b/pkg/api/handlers/compat/containers.go
index 0b82c48f6..61d6fc86d 100644
--- a/pkg/api/handlers/compat/containers.go
+++ b/pkg/api/handlers/compat/containers.go
@@ -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
@@ -488,7 +488,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,