Skip to content

api: image inspect: remove temporary backfill for Config fields#50915

Merged
thaJeztah merged 1 commit intomoby:masterfrom
thaJeztah:omit_empty_config
Sep 11, 2025
Merged

api: image inspect: remove temporary backfill for Config fields#50915
thaJeztah merged 1 commit intomoby:masterfrom
thaJeztah:omit_empty_config

Conversation

@thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Sep 5, 2025

Commit 4dc961d (API v1.50) fixed the type used for Config to point to the correct type, which is the Config struct from the Docker image spec (which embeds the OCI Image Specification type); however, those types use an omitempty, which wasn't documented as part of the API changes, so f85394d added a temporary backfill for empty fields.

This removes that backfill for API v1.52 so that empty image config fields are now omitted.

- What I did

- How I did it

- How to verify it

- Human readable description for the release notes

`GET /images/{name}/json`: omit empty `Config` fields when not set.

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

@thaJeztah thaJeztah added this to the 29.0.0 milestone Sep 5, 2025
Commit 4dc961d (API v1.50) fixed the type
used for Config to point to the correct type, which is the Config struct
from the [Docker image spec] (which embeds the [OCI Image Specification]
type); however, those types use an omitempty, which wasn't documented as
part of the API changes, so f85394d added
a temporary backfill for empty fields.

This removes that backfill for API v1.52 so that empty image config fields
are now omitted.

[OCI Image Specification]: https://github.com/opencontainers/image-spec/blob/v1.1.1/specs-go/v1/config.go#L23-L62
[Docker image spec]: https://github.com/moby/docker-image-spec/blob/v1.3.1/specs-go/v1/image.go#L19-L32

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah marked this pull request as ready for review September 5, 2025 23:17
@thaJeztah thaJeztah added the release-blocker PRs we want to block a release on label Sep 8, 2025
@thaJeztah thaJeztah merged commit 183f151 into moby:master Sep 11, 2025
181 checks passed
@thaJeztah thaJeztah deleted the omit_empty_config branch September 11, 2025 19:21
@thompson-shaun thompson-shaun moved this from New to Complete in 🔦 Maintainer spotlight Sep 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/api API impact/api impact/changelog kind/refactor PR's that refactor, or clean-up code release-blocker PRs we want to block a release on status/2-code-review

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

3 participants