summaryrefslogtreecommitdiff
path: root/pkg
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2022-09-01 10:58:33 +0200
committerGitHub <noreply@github.com>2022-09-01 10:58:33 +0200
commit72f4c77139adf61bc39890e08ed9b86c365ae09b (patch)
treedcc20dee9e897343216322dc55a27f1ec88fd354 /pkg
parent009afb50b308548eb129bc68e654db6c6ad82e7a (diff)
parent368fa6074da72f4215b5fc5a5be974f17b45298d (diff)
downloadpodman-72f4c77139adf61bc39890e08ed9b86c365ae09b.tar.gz
podman-72f4c77139adf61bc39890e08ed9b86c365ae09b.tar.bz2
podman-72f4c77139adf61bc39890e08ed9b86c365ae09b.zip
Merge pull request #15360 from m0duspwnens/api_compat_containers
api: return imageID instead of imageName, for "Image" when Podman api is queried
Diffstat (limited to 'pkg')
-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,