container: collect Hyper-V isolated containers from CRI stats (#2568)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Jan-Otto Kröpke <mail@jkroepke.de>
This commit is contained in:
Jan-Otto Kröpke
2026-10-09 09:15:51 +02:00
committed by GitHub
co-authored by Claude Opus 5.5
parent 200f248eba
commit fedca642a1
7 changed files with 649 additions and 36 deletions
+10
View File
@@ -121,6 +121,16 @@ func (c *Client) ListPodSandboxes(ctx context.Context) ([]PodSandbox, error) {
return decodeListPodSandboxResponse(resp)
}
// ListContainerStats returns the stats of all containers.
func (c *Client) ListContainerStats(ctx context.Context) ([]ContainerStats, error) {
resp, err := c.call(ctx, "ListContainerStats", nil)
if err != nil {
return nil, err
}
return decodeListContainerStatsResponse(resp)
}
// call performs a unary gRPC call and returns the response message.
func (c *Client) call(ctx context.Context, method string, msg []byte) ([]byte, error) {
// A gRPC message is prefixed by a compression flag and its length.