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>
This change prevents changes to the otel version from affecting the otel
sdk version. This is done by copying the telemetry sdk implementation
locally and using our own choice for semconv from within that.
This prevents a schema conflict from happening since the otel version of
the sdk gets implicitly updated whenever the semconv changes while we
have to manually change ours. Now, we manually change both and they're
locked to each other.
Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The `--tree` implementation already does this.
Make the behavior consistent for the legacy image list implementation.
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
Some tests had to be skipped as there's some issues to address, and
some of the result-types cannot be mocked / stubbed.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This utility was used internally and will be removed in the next release.
Use `DetectContextType` to detect the context-type, and use `GetContextFromLocalDir`,
`GetContextFromLocalDir`, `GetContextFromGitURL`, or `GetContextFromURL`
instead.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>