mirror of
https://github.com/moby/moby.git
synced 2026-01-11 18:51:37 +00:00
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. Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This commit is contained in:
@@ -36,12 +36,8 @@ type ContainerStatsOptions struct {
|
||||
// It wraps an [io.ReadCloser] that provides one or more [container.StatsResponse]
|
||||
// objects for a container, as produced by the "GET /containers/{id}/stats" endpoint.
|
||||
// If streaming is disabled, the stream contains a single record.
|
||||
//
|
||||
// The OSType field reports the daemon's operating system, allowing platform-specific
|
||||
// handling of the response.
|
||||
type ContainerStatsResult struct {
|
||||
Body io.ReadCloser
|
||||
OSType string // TODO(thaJeztah): consider moving OSType into [container.StatsResponse].
|
||||
Body io.ReadCloser
|
||||
}
|
||||
|
||||
// ContainerStats retrieves live resource usage statistics for the specified
|
||||
@@ -72,7 +68,6 @@ func (cli *Client) ContainerStats(ctx context.Context, containerID string, optio
|
||||
}
|
||||
|
||||
return ContainerStatsResult{
|
||||
Body: resp.Body,
|
||||
OSType: resp.Header.Get("Ostype"),
|
||||
Body: resp.Body,
|
||||
}, nil
|
||||
}
|
||||
|
||||
9
vendor/github.com/moby/moby/client/container_stats.go
generated
vendored
9
vendor/github.com/moby/moby/client/container_stats.go
generated
vendored
@@ -36,12 +36,8 @@ type ContainerStatsOptions struct {
|
||||
// It wraps an [io.ReadCloser] that provides one or more [container.StatsResponse]
|
||||
// objects for a container, as produced by the "GET /containers/{id}/stats" endpoint.
|
||||
// If streaming is disabled, the stream contains a single record.
|
||||
//
|
||||
// The OSType field reports the daemon's operating system, allowing platform-specific
|
||||
// handling of the response.
|
||||
type ContainerStatsResult struct {
|
||||
Body io.ReadCloser
|
||||
OSType string // TODO(thaJeztah): consider moving OSType into [container.StatsResponse].
|
||||
Body io.ReadCloser
|
||||
}
|
||||
|
||||
// ContainerStats retrieves live resource usage statistics for the specified
|
||||
@@ -72,7 +68,6 @@ func (cli *Client) ContainerStats(ctx context.Context, containerID string, optio
|
||||
}
|
||||
|
||||
return ContainerStatsResult{
|
||||
Body: resp.Body,
|
||||
OSType: resp.Header.Get("Ostype"),
|
||||
Body: resp.Body,
|
||||
}, nil
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user