Skip to content

api/types/image: InspectResponse: deprecate Parent, DockerVersion#51104

Merged
thaJeztah merged 1 commit intomoby:masterfrom
thaJeztah:deprecate_legacy_inspect_fields
Oct 6, 2025
Merged

api/types/image: InspectResponse: deprecate Parent, DockerVersion#51104
thaJeztah merged 1 commit intomoby:masterfrom
thaJeztah:deprecate_legacy_inspect_fields

Conversation

@thaJeztah
Copy link
Member

@thaJeztah thaJeztah commented Oct 5, 2025

relates to:

api/types/image: InspectResponse: deprecate Parent, DockerVersion

The image inspect response has various fields that were deprecated as
part of the legacy builder, or Dockerfile syntax;

  • The Parent field is only used for the legacy builder, and only set for
    images that are built locally (i.e., not persisted when pulling an image).
  • The DockerVersion field is only set when building images with the legacy
    builder, and empty in most cases.

This patch deprecates the fields in the InspectResponse go struct, as
these fields will no longer be set in future once the legacy builder is
removed (Parent, DockerVersion). The legacy builder's deprecation in
cli@4d8e457 / cli@fd22746 (docker 23.0, API v1.42), however the related
API fields were kept so that information of legacy images would not be
discarded.

The API continues to return these fields if set, allowing the client to
print the fields for informational purposes when printing the raw response,
but these fields should be considered "transitional", and not be depended
on; deprecating the fields helps raise awareness.

- What I did

- How I did it

- How to verify it

- Human readable description for the release notes

api/types/image: InspectResponse: deprecate `Parent` and `DockerVersion` fields.

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

// This field is omitted if not set.
//
// Deprecated: this field is deprecated, and will be removed in the next release.
Author string `json:",omitempty"`
Copy link
Member Author

Choose a reason for hiding this comment

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

Moved back to draft for now; perhaps depreciating Author is a bit too aggressive, as there's an equivalent in the OCI as well; https://github.com/opencontainers/image-spec/blob/6519a62d628ec31b5da156de745b516d8850c8e3/specs-go/v1/config.go#L98

Copy link
Member Author

@thaJeztah thaJeztah Oct 5, 2025

Choose a reason for hiding this comment

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

OK; reverted this part; not deprecating Author for now (but we can do in a follow-up)

@thaJeztah thaJeztah changed the title api/types/image: InspectResponse: deprecate Parent, DockerVersion, Author api/types/image: InspectResponse: deprecate Parent, DockerVersion Oct 5, 2025
The image inspect response has various fields that were deprecated as
part of the legacy builder, or Dockerfile syntax;

- The `Parent` field is only used for the legacy builder, and only set for
  images that are built locally (i.e., not persisted when pulling an image).
- The `DockerVersion` field is only set when building images with the legacy
  builder, and empty in most cases.

This patch deprecates the fields in the `InspectResponse` go struct, as
these fields will no longer be set in future once the legacy builder is
removed (`Parent`, `DockerVersion`). The legacy builder's deprecation in
[cli@4d8e457] / [cli@fd22746] (docker 23.0, API v1.42), however the related
API fields were kept so that information of legacy images would not be
discarded.

The API continues to return these fields if set, allowing the client to
print the fields for informational purposes when printing the raw response,
but these fields should be considered "transitional", and not be depended
on; deprecating the fields helps raise awareness.

[cli@4d8e457]: docker/cli@4d8e457
[cli@fd22746]: docker/cli@fd22746

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah force-pushed the deprecate_legacy_inspect_fields branch from b47c611 to bd8a99b Compare October 5, 2025 21:01
@thaJeztah thaJeztah marked this pull request as ready for review October 5, 2025 21:07
@thaJeztah thaJeztah merged commit 4044497 into moby:master Oct 6, 2025
183 checks passed
@thaJeztah thaJeztah deleted the deprecate_legacy_inspect_fields branch October 6, 2025 09:42
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.

2 participants