fussybeaver / bollard

Docker daemon API in Rust

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

one-shot stats fails with Docker 24.0.7

rolyatmax opened this issue · comments

Docker 24.0.7 recently landed which includes this change to the docker stats functionality to speed up the collection of one-shot stats.

This new code path ends up returning a response that omits the name and id fields from the stats object, however. Docker seems to have been treating those fields as optional. Bollard doesn't, though. This means that this:

docker.stats(&container, Some(StatsOptions {
    stream: false,
    one_shot: true,
}))

always fails with a JsonDataError { message: "missing field 'name' at line ... }

UPDATE:

I've revised this issue description and the associated PR to reflect that the id field is also missing from the stats object when collecting one-shot stats.