Skip to content

Commit

Permalink
Merge pull request #12705 from olitha/compat-api-containers-sha256
Browse files Browse the repository at this point in the history
Compat api containers ImageId missing sha256
  • Loading branch information
openshift-merge-robot authored Dec 29, 2021
2 parents e06631d + a268778 commit 807f7cf
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pkg/api/handlers/compat/containers.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ func LibpodToContainer(l *libpod.Container, sz bool) (*handlers.Container, error
ID: l.ID(),
Names: []string{fmt.Sprintf("/%s", l.Name())},
Image: imageName,
ImageID: imageID,
ImageID: "sha256:" + imageID,
Command: strings.Join(l.Command(), " "),
Created: l.CreatedTime().Unix(),
Ports: ports,
Expand Down
4 changes: 4 additions & 0 deletions test/apiv2/20-containers.at
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ t GET /containers/json?all=true 200 \
.[0].Image=$IMAGE \
$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.
t GET libpod/containers/json?limit=1 200 \
length=1 \
Expand Down

0 comments on commit 807f7cf

Please sign in to comment.