mirror of
https://github.com/containers/podman
synced 2024-10-19 00:34:18 +00:00
Merge pull request #15360 from m0duspwnens/api_compat_containers
api: return imageID instead of imageName, for "Image" when Podman api is queried
This commit is contained in:
commit
72f4c77139
|
@ -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,
|
||||
|
|
|
@ -309,7 +309,9 @@ t POST containers/create Image=${MultiTagName} 201 \
|
|||
.Id~[0-9a-f]\\{64\\}
|
||||
cid=$(jq -r '.Id' <<<"$output")
|
||||
t GET containers/$cid/json 200 \
|
||||
.Image=${MultiTagName}
|
||||
.Config.Image=${MultiTagName} \
|
||||
.Image~sha256:[0-9a-f]\\{64\\}
|
||||
|
||||
t DELETE containers/$cid 204
|
||||
t DELETE images/${MultiTagName} 200
|
||||
# vim: filetype=sh
|
||||
|
|
|
@ -9,7 +9,7 @@ t POST "images/create?fromImage=quay.io/libpod/alpine:latest" 200 .error~null .s
|
|||
# 14291 - let a short-name resolve to a *local* non Docker-Hub image.
|
||||
t POST containers/create Image=alpine 201 .Id~[0-9a-f]\\{64\\}
|
||||
cid=$(jq -r '.Id' <<<"$output")
|
||||
t GET containers/$cid/json 200 .Image="quay.io/libpod/alpine:latest"
|
||||
t GET containers/$cid/json 200 .Config.Image="quay.io/libpod/alpine:latest" .Image~sha256:[0-9a-f]\\{64\\}
|
||||
podman rm -f $cid
|
||||
|
||||
########## TAG
|
||||
|
|
Loading…
Reference in a new issue