Skip to content

c8d/list: Return Descriptor#48861

Merged
thaJeztah merged 1 commit intomoby:masterfrom
vvoland:c8d-list-index
Nov 14, 2024
Merged

c8d/list: Return Descriptor#48861
thaJeztah merged 1 commit intomoby:masterfrom
vvoland:c8d-list-index

Conversation

@vvoland
Copy link
Copy Markdown
Contributor

@vvoland vvoland commented Nov 13, 2024

While the endpoint returns a detailed information about its children, it doesn't actually expose the descriptor of the root OCI index/manifest list.

This commits adds the target description to the returned JSON.

- How to verify it

unit test: TestImageList

manual:

$  docker pull alpine # multi-platform index image
Using default tag: latest
latest: Pulling from library/alpine
9986a736f7d3: Download complete 
Digest: sha256:1e42bbe2508154c9126d48c2b8a75420c3544343bf86fd041fb7527e017a4b4a
Status: Downloaded newer image for alpine:latest
docker.io/library/alpine:latest

$ docker pull arm64v8/alpine:3.20.0 # single-platform manifest image
3.20.0: Pulling from arm64v8/alpine
94747bd81234: Download complete 
Digest: sha256:1c3b93ed450e26eac89b471d6d140e2f99488f489739b8b8ea5e8202dd086f82
Status: Downloaded newer image for arm64v8/alpine:3.20.0
docker.io/arm64v8/alpine:3.20.0

$ curl -s --unix-socket /var/run/docker.sock localhost/images/json | jq
[
  {
    "Containers": -1,
    "Created": 1725624336,
    "Id": "sha256:1e42bbe2508154c9126d48c2b8a75420c3544343bf86fd041fb7527e017a4b4a",
    "Labels": null,
    "ParentId": "",
    "Descriptor": {
      "mediaType": "application/vnd.oci.image.index.v1+json",
      "digest": "sha256:1e42bbe2508154c9126d48c2b8a75420c3544343bf86fd041fb7527e017a4b4a",
      "size": 9218
    },
    "RepoDigests": [
      "alpine@sha256:1e42bbe2508154c9126d48c2b8a75420c3544343bf86fd041fb7527e017a4b4a"
    ],
    "RepoTags": [
      "alpine:latest"
    ],
    "SharedSize": -1,
    "Size": 13575703
  },
  {
    "Containers": -1,
    "Created": 1716401848,
    "Id": "sha256:1c3b93ed450e26eac89b471d6d140e2f99488f489739b8b8ea5e8202dd086f82",
    "Labels": null,
    "ParentId": "",
    "Descriptor": {
      "mediaType": "application/vnd.docker.distribution.manifest.v2+json",
      "digest": "sha256:1c3b93ed450e26eac89b471d6d140e2f99488f489739b8b8ea5e8202dd086f82",
      "size": 528
    },
    "RepoDigests": [
      "arm64v8/alpine@sha256:1c3b93ed450e26eac89b471d6d140e2f99488f489739b8b8ea5e8202dd086f82"
    ],
    "RepoTags": [
      "arm64v8/alpine:3.20.0"
    ],
    "SharedSize": -1,
    "Size": 13575127
  }

- Description for the changelog

containerd image store: `GET /images/json` response now includes `Descriptor` field, which contains an OCI descriptor of the image target.

- A picture of a cute animal (not mandatory but encouraged)

While the endpoint returns a detailed information about its children, it
doesn't actually expose the descriptor of the root OCI index/manifest
list.
This commits adds the target description to the returned JSON.

Signed-off-by: Paweł Gronowski <[email protected]>
@vvoland vvoland added area/api API impact/api impact/changelog containerd-integration Issues and PRs related to containerd integration labels Nov 13, 2024
@vvoland vvoland added this to the 28.0.0 milestone Nov 13, 2024
@vvoland vvoland self-assigned this Nov 13, 2024
Copy link
Copy Markdown
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thaJeztah thaJeztah merged commit cd8d2c5 into moby:master Nov 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/api API containerd-integration Issues and PRs related to containerd integration impact/api impact/changelog

Projects

Development

Successfully merging this pull request may close these issues.

3 participants