Skip to content

api/types/container: StatsResponse: add OSType field, remove client.ContainerStatsResult.OSType#51305

Merged
thaJeztah merged 2 commits intomoby:masterfrom
thaJeztah:stats_ostype
Oct 27, 2025
Merged

api/types/container: StatsResponse: add OSType field, remove client.ContainerStatsResult.OSType#51305
thaJeztah merged 2 commits intomoby:masterfrom
thaJeztah:stats_ostype

Conversation

@thaJeztah
Copy link
Member

api/types/container: StatsResponse: add OSType field

Adds a per-stats OSType field to allow handle the platform-specific fields.
Before this change, the client had to get the OSType field from the server's
API response header and copy it to each record.

Older daemon versions don't have this field, so the client still needs to
handle fallbacks.

client: remove ContainerStatsResult.OSType field

The API now includes this information per record, and clients can
get this information using the Ping method if needed as fallback.

- Human readable description for the release notes

api/types/container: StatsResponse: add OSType field
client: remove client.ContainerStatsResult.OSType field.

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

Adds a per-stats OSType field to allow handle the platform-specific fields.
Before this change, the client had to get the OSType field from the server's
API response header and copy it to each record.

Older daemon versions don't have this field, so the client still needs to
handle fallbacks.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The API now includes this information per record, and clients can
get this information using the `Ping` method if needed as fallback.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah marked this pull request as ready for review October 27, 2025 18:29
example: "boring_wozniak"
os_type:
description: |
OSType is the OS of the container ("linux" or "windows") to allow
Copy link
Contributor

Choose a reason for hiding this comment

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

Could drop the "OSType is"? (Or call it "os_type"?)

Copy link
Member Author

Choose a reason for hiding this comment

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

Ah, yeah, I stuck with the GoDoc format for these, with the anticipation that we may be generating these from swagger at some point 😅

But indeed for the Swagger probably doesn't make sense for this one. I'll leave it for a cleanup round after this 😅

@thaJeztah thaJeztah merged commit bbf3dea into moby:master Oct 27, 2025
254 of 255 checks passed
@thaJeztah thaJeztah deleted the stats_ostype branch October 27, 2025 20:14
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.

4 participants