mirror of
https://github.com/containers/podman.git
synced 2025-12-17 05:01:09 +08:00
prefix imageId with sha256: in containers list
test for compat API ImageId Signed-off-by: Oliver Thallmair <oliver.thallmair@mailbox.org>
This commit is contained in:
@@ -360,7 +360,7 @@ func LibpodToContainer(l *libpod.Container, sz bool) (*handlers.Container, error
|
|||||||
ID: l.ID(),
|
ID: l.ID(),
|
||||||
Names: []string{fmt.Sprintf("/%s", l.Name())},
|
Names: []string{fmt.Sprintf("/%s", l.Name())},
|
||||||
Image: imageName,
|
Image: imageName,
|
||||||
ImageID: imageID,
|
ImageID: "sha256:" + imageID,
|
||||||
Command: strings.Join(l.Command(), " "),
|
Command: strings.Join(l.Command(), " "),
|
||||||
Created: l.CreatedTime().Unix(),
|
Created: l.CreatedTime().Unix(),
|
||||||
Ports: ports,
|
Ports: ports,
|
||||||
|
|||||||
@@ -46,6 +46,10 @@ t GET /containers/json?all=true 200 \
|
|||||||
.[0].Image=$IMAGE \
|
.[0].Image=$IMAGE \
|
||||||
$network_expect
|
$network_expect
|
||||||
|
|
||||||
|
# compat API imageid with sha256: prefix
|
||||||
|
t GET containers/json?limit=1 200 \
|
||||||
|
.[0].ImageID~sha256:[0-9a-f]\\{64\\}
|
||||||
|
|
||||||
# Make sure `limit` works.
|
# Make sure `limit` works.
|
||||||
t GET libpod/containers/json?limit=1 200 \
|
t GET libpod/containers/json?limit=1 200 \
|
||||||
length=1 \
|
length=1 \
|
||||||
|
|||||||
Reference in New Issue
Block a user