This code was using swarmkit's genericresource package as intermediate;
add a local copy of that code that skips the protobufs as intermediate.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Various dependencies, including "golang.org/x/.." started to update
the minimum required version,so we should follow suit for the next
release.
Note that the `//go:build` directives not necesserily have to be
updated, but it's good to keep them in sync until we have a go.mod
to control this.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This was introduced in dad1d367c8, which
did not add a `//go:build` constraint to enable the use of generics (`any`).
Which causes an error when used;
could not import github.com/docker/cli/cli/command/container (-: # github.com/docker/cli/cli/command/container
/Users/thajeztah/go/pkg/mod/github.com/docker/cli@v29.0.0-rc.2+incompatible/cli/command/container/stats.go:148:39: predeclared any requires go1.18 or later (-lang was set to go1.16; check go.mod)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Use the new tree view by default and only fallback if format or old
view-related options are used.
The expanded view is shown when `--tree` is passed.
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
The logic for applying the dangling filter when `--all` is not used was
inverted. The filter was being applied when the dangling filter was
present, but it should be applied when the dangling filter is NOT
present.
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Sort images alphabetically by their repository tags rather than by
creation date.
When an image has multiple tags, they are sorted internally and the
first tag is used as the representative for sorting the image in the
list. Untagged images are placed at the end.
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Use separate branches to handle windows/unix results to reduce intermediate
variables, and make it more transparent what's set for each platform.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
construct the decoder inside the go-routine, including closing the body,
and add handling for context-cancellation.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
We should consider splitting this out to a separate function, but
start with just an early return before we hit the timer-loop.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The JSON field was added in [moby@9fd2c0f], to address [moby#19177], which
reported an incompatibility with Classic (V1) Swarm, which produced a non-
standard response;
> Make docker load to output json when the response content type is json
> Swarm hijacks the response from docker load and returns JSON rather
> than plain text like the Engine does. This makes the API library to return
> information to figure that out.
A later change in [moby@96d7db6] added additional logic to make sure the
correct content-type was returned, depending on whether the `quiet` option
was set (which produced a non-JSON response). This caused inconsistency in
the API response, and [moby@2f27632] changed the endpoint to always produce
JSON (only skipping the "progress" output if `quiet` was set).
This means that the "load" endpoint ([`imageRouter.postImagesLoad`]) now
unconditionally returns JSON, making the `JSON` field fully redundant.
This patch removes the use of the JSON field, as it's redundant, and the way it handles
the content-type is incorrect because it would not handle correct, but different
formatted response-headers (`application/json; charset=utf-8`), which could
result in malformed output on the client.
[moby@9fd2c0f]: 9fd2c0feb0
[moby#19177]: https://github.com/moby/moby/issues/19177
[moby@96d7db6]: 96d7db665b
[moby@2f27632]: 2f27632cde
[`imageRouter.postImagesLoad`]: 7b9d2ef6e5/api/server/router/image/image_routes.go (L248-L255)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This field is set for the request as a whole, so can be obtained
from the server-info instead. Docker v29 will provide per-stats
information.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>