Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[24.0 backport] api/inspect: Fix nil RepoTags and RepoDigests #45564

Merged
merged 1 commit into from May 18, 2023

Conversation

vvoland
Copy link
Contributor

@vvoland vvoland commented May 18, 2023

#43883 removed the variable initialization to empty arrays which silently changed the API and made it return nil RepoTags and RepoDigests instead of empty arrays.

acd0aa7#diff-2d8d96f6fa256de94f3737c8631e99d897efb15ec869f465f8cfcb8962e70be0R208-R210

(cherry picked from commit 1be26e9)

- What I did
Make RepoTags and RepoDigests empty arrays instead of nil.

- How I did it
Set RepoTags/RepoDigests to empty array if it's nil.

- How to verify it

# Before
$  docker inspect ead3e795a244 | head -n5
[
    {
        "Id": "sha256:ead3e795a244cfa86bff5eda3d7ce08a910b976453132b63a503546c80bfee13",
        "RepoTags": null,
        "RepoDigests": null,

# After
$  docker inspect ead3e795a244 | head -n5
[
    {
        "Id": "sha256:ead3e795a244cfa86bff5eda3d7ce08a910b976453132b63a503546c80bfee13",
        "RepoTags": [],
        "RepoDigests": [],

- Description for the changelog

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

Make RepoTags and RepoDigests empty arrays instead of nil.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
(cherry picked from commit 1be26e9)
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
@vvoland vvoland added this to the 24.0.1 milestone May 18, 2023
@thaJeztah thaJeztah changed the title api/inspect: Fix nil RepoTags and RepoDigests [24.0 backport] api/inspect: Fix nil RepoTags and RepoDigests May 18, 2023
Copy link
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

@cpuguy83 cpuguy83 merged commit ea662c5 into moby:24.0 May 18, 2023
92 of 94 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants