Commit Graph

663 Commits

Author SHA1 Message Date
Sebastiaan van Stijn
35167dc616 client: Client: PluginInstall, PluginUpgrade: remove/rename err-returns
Prevent accidentally shadowing these errors, which are used in defers, and
while at it, also fixed some linting warnings about unhandled errors.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-04-26 15:47:11 +02:00
Sebastiaan van Stijn
91ba210bc8 Merge pull request #49666 from thaJeztah/legacy_errors
api, client: produce human-readable errors for unsupported API versions (< v1.24)
2025-04-10 12:08:56 +02:00
Paweł Gronowski
59169d0f97 image/inspect: Add platform selection
`GET /image/{name}/json` now supports `platform` parameter allowing to
specify which platform variant of a multi-platform image to inspect.

For servers that do not use containerd image store integration, this
option will cause an error if the requested platform doesn't match the
image's actual platform

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-04-03 13:57:51 +02:00
Sebastiaan van Stijn
843e51459f Merge pull request #49609 from thaJeztah/client_more_canonical
client: keep image refs in canonical format where possible
2025-04-01 09:43:52 +02:00
Sebastiaan van Stijn
126d4cf672 client: remove version-gate for JSON response errors
JSON errors were introduced in API 1.24, and daemons running older versions of
the API would return errors as plain-text. However, such API versions would
also send the corresponding content-type header (text/plain), so we don't
really need to make the code version-dependent; there's already fallbacks
in place to handle JSON-responses that don't use the expected format, in
which case we produce a generic status-code error.

Before this patch, the client would print JSON-responses as-is when the
daemon returned an "API version too old" error;

    DOCKER_API_VERSION=v1.10 docker info --format '{{.ID}}'
    Error response from daemon: {"message":"client version 1.10 is too old. Minimum supported API version is 1.24, please upgrade your client to a newer version"}

With this patch, the client detects that the response is JSON, and prints
a friendlier error-message to help the user discover their client is too
old;

    DOCKER_API_VERSION=v1.10 docker info --format '{{.ID}}'
    Error response from daemon: client version 1.10 is too old. Minimum supported API version is 1.24, please upgrade your client to a newer version

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-03-20 20:25:11 +01:00
Sebastiaan van Stijn
5d6b56699d client: add API-version dependent validation for mount options
[docker/cli@fc6976d] added support for recursive readonly mounts in the
CLI, adding a ValidateMountWithAPIVersion utility to verify if options
used were supported by the API version.

We usually keep API-version dependent checks in the client, so that
docker/cli (and other users of the client) don't have to implement
their own validation for these.

This patch moves the functionality of ValidateMountWithAPIVersion to
the client.

Once the docker/cli vendoring was updated, we can remove the utility
there.

[docker/cli@fc6976d]: fc6976db45

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-03-09 22:03:00 +01:00
Sebastiaan van Stijn
0823d76ec5 client: keep image refs in canonical format where possible
Using "familiarname" (e.g. "ubuntu") should be mostly done for presenting
image refernces to the user, but internally, we should use the canonical
format where possible ("docker.io/library/ubuntu").

There's still many places where we use the familiar (short) form, but
let's start with not converting references in the client.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-03-09 16:52:21 +01:00
Sebastiaan van Stijn
5af7c47f0e Merge pull request #49420 from thaJeztah/client_remove_serverResponse
client: remove serverResponse and use http.Response directly
2025-02-14 16:40:38 +01:00
Paweł Gronowski
903ba2f487 client: Move opts to separate files
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-02-14 14:45:08 +01:00
Paweł Gronowski
b9319f64ed client: Change ImageSave to use functional options
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-02-14 14:25:39 +01:00
Paweł Gronowski
ae4c688fd8 client: Change ImageLoad to use functional options
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-02-14 14:25:37 +01:00
Paweł Gronowski
85808a6abf client: Change ImageHistory to use functional options
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-02-14 13:55:30 +01:00
Paweł Gronowski
068aa86c23 client: Group deprecated functions into ImageAPIClientDeprecated
Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-02-14 13:55:07 +01:00
Sebastiaan van Stijn
72c91e378d client: remove serverResponse and use http.Response directly
Looking in history to learn why this struct existed, shows that this type
was mostly the result of tech-debt accumulating over time;

- originally ([moby@1aa7f13]) most of the request handling was internal;
  the [`call()` function][1] would make a request, read the `response.Body`,
  and return it as a `[]byte` (or an error if one happened).
- some features needed the statuscode, so [moby@a4bcf7e] added an extra
  output variable to return the `response.StatusCode`.
- some new features required streaming, so [moby@fdd8d4b] changed the
  function to return the `response.Body` as a `io.ReadCloser`, instead
  of a `[]byte`.
- some features needed access to the content-type header, so a new
  `clientRequest` method was introduced in [moby@6b2eeaf] to read the
  `Content-Type` header from `response.Headers` and return it as a string.
- of course, `Content-Type` may not be the only header needed, so [moby@0cdc3b7]
  changed the signature to return `response.Headers` as a whole as a
  `http.Header`
- things became a bit unwieldy now, with the function having four (4) output
  variables, so [moby@126529c] chose to refactor this code, introducing a
  `serverResponse` struct to wrap them all, not realizing that all these
  values were effectively deconstructed from the `url.Response`, so now
  re-assembling them into our own "URL response", only preserving a subset
  of the information available.
- now that we had a custom struct, it was possible to add more information
  to it without changing the signature. When there was a need to know the
  URL of the request that initiated the response, [moby@27ef09a] introduced
  a `reqURL` field to hold the `request.URL` which notably also is available
  in `response.Request.URL`.

In short;

- The original implementation tried to (pre-maturely) abstract the underlying
  response to provide a simplified interface.
- While initially not needed, abstracting caused relevant information from
  the response (and request) to be unavailable to callers.
- As a result, we ended up in a situation where we are deconstructing the
  original `url.Response`, only to re-assemble it into our own, custom struct
  (`serverResponsee`) with only a subset of the information preserved.

This patch removes the `serverResponse` struct, instead returning the
`url.Response` as-is, so that all information is preserved, allowing callers
to use the information they need.

There is one follow-up change to consider; commit [moby@589df17] introduced
a `ensureReaderClosed` utility. Before that commit, the response body would
be closed in a more idiomatic way through a [`defer serverResp.body.Close()`][2].
A later change in [docker/engine-api@5dd6452] added an optimization to that
utility, draining the response to allow connections to be reused. While
skipping that utility (and not draining the response) would not be a critical
issue, it may be easy to overlook that utility, and to close the response
body in the "idiomatic" way, resulting in a possible performance regression.

We need to check if that optimization is still relevant or if later changes
in Go itself already take care of this; we should also look if context
cancellation is handled correctly for these. If it's still relevant, we could

- Wrap the the `url.Response` in a custom struct ("drainCloser") to provide
  a `Close()` function handling the draining and closing; this would re-
  introduce a custom type to be returned, so perhaps not what we want.
- Wrap the `url.Response.Body` in the response returned (so, calling)
  `response.Body.Close()` would call the wrapped closer.
- Change the signature of `Client.sendRequest()` (and related) to return
  a `close()` func to handle this; doing so would more strongly encourage
  callers to close the response body.

[1]: 1aa7f1392d/commands.go (L1008-L1027)
[2]: 589df17a1a/api/client/ps.go (L84-L89)
[moby@1aa7f13]: 1aa7f1392d
[moby@a4bcf7e]: a4bcf7e1ac
[moby@fdd8d4b]: fdd8d4b7d9
[moby@6b2eeaf]: 6b2eeaf896
[moby@0cdc3b7]: 0cdc3b7539
[moby@126529c]: 126529c6d0
[moby@27ef09a]: 27ef09a46f
[moby@589df17]: 589df17a1a
[docker/engine-api@5dd6452]: 5dd6452d4d

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-02-11 13:20:27 +01:00
Sebastiaan van Stijn
6856bdd5a6 Merge pull request #49444 from thaJeztah/commit_and_exect_response
api/types/container: introduce CommitResponse, ExecCreateResponse types
2025-02-11 12:53:09 +01:00
Sebastiaan van Stijn
13ffbd6cc4 Merge pull request #49442 from thaJeztah/api_rename_container_responses
api/types/container: rename ContainerUpdateOKBody to UpdateResponse, ContainerTopOKBody to TopResponse
2025-02-11 12:52:17 +01:00
Sebastiaan van Stijn
9a20edf7b6 api/types/container: introduce ExecCreateResponse type
Introduce a container.ExecCreateResponse type as alias for IDResponse to allow
consumers to use ContainerCommit without having to import the "types" package,
and allows us to differentiate the response for container commit separate from
other endpoints currently using IDResponse.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-02-10 21:14:11 +01:00
Sebastiaan van Stijn
0df3a0047a api/types/container: introduce CommitResponse type
Move api/types.IDResponse to a "common" package (to prevent cyclic import
issues), and introduce a container.CommitResponse type as alias. This allows
consumers to use ContainerCommit without having to import the "types" package,
and allows us to differentiate the response for container commit separate from
other endpoints currently using IDResponse.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-02-10 21:14:03 +01:00
Sebastiaan van Stijn
be1ac5d8e5 api/types/container: rename ContainerTopOKBody to TopResponse
Deprecate ContainerTopOKBody, but keep an alias.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-02-10 18:58:31 +01:00
Sebastiaan van Stijn
f4dc38cd36 api/types/container: rename ContainerUpdateOKBody to UpdateResponse
Deprecate ContainerUpdateOKBody, but keep an alias.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-02-10 18:35:35 +01:00
Brian Goff
8ca7679631 Merge pull request #49415 from NathanBaulch/traceopts
client: custom trace options
2025-02-10 07:54:26 -08:00
Sebastiaan van Stijn
b4af9341af client: fix deprecation comment for ImageInspectWithRaw
The comment was not formatted correctly as it was not the last line,
resulting in some editors / linters not detecting the deprecation.

Updates 639a1214fa

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-02-09 14:03:29 +01:00
Nathan Baulch
1784026740 client: custom trace options
Signed-off-by: Nathan Baulch <nathan.baulch@gmail.com>
2025-02-08 18:04:18 +11:00
Paweł Gronowski
3d37537f75 c8d/inspect: Add Manifests field
Add `Manifests` field to image inspect (`/images/{name}/json`) response.
This is the same as in `/images/json`.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-02-06 13:30:24 +01:00
Paweł Gronowski
639a1214fa client/image-inspect: Introduce client opts
Deprecate ImageInspectWithRaw and add a simpler ImageInspect function
which takes optional options.

Signed-off-by: Paweł Gronowski <pawel.gronowski@docker.com>
2025-02-06 13:30:22 +01:00
Sebastiaan van Stijn
63ea5dc10e Merge pull request #49388 from thaJeztah/client_unify_interfaces
client: deprecate CommonAPIClient interface, add HijackDialer, SwarmManagementAPIClient interfaces
2025-02-04 22:50:24 +01:00
Sebastiaan van Stijn
2997c0ddc0 client: deprecate CommonAPIClient interface
The CommonAPIClient was used to define all the stable interfaces,
and combined with the experimental ones through APIClient. In theory,
this would allow someone to make sure they only depended on non-experimental
methods or to implement an alternative client that only implements the
stable methods.

While there are users currently using this interface, all those uses
depend on the actual client implementation, not a custom one, so they
should be able to switch to use APIClient instead. In the meantime,
start with deprecating, but keeping the interface the same for now,
scheduling it to become an alias, and removed in a future release.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-02-04 17:21:31 +01:00
Sebastiaan van Stijn
846b2272e6 client: deprecate ErrorConnectionFailed helper
This function was only used internally, and will be removed in the next release.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-02-04 17:16:52 +01:00
Sebastiaan van Stijn
e93ff742e8 client: doRequest: use errors.As for error-detection
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-02-04 17:09:59 +01:00
Sebastiaan van Stijn
3725998e7d client: define interface for all Swarm-specific methods
Introduce a SwarmManagementAPIClient interface that captures
all swarm-specific methods on the API client.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-02-04 16:56:08 +01:00
Sebastiaan van Stijn
a57d737a86 client: define separate interface for HijackDialer
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-02-04 16:44:12 +01:00
Sebastiaan van Stijn
902c06fdf0 client: make setupHijackConn a regular function
pass the dialer as argument

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-02-04 16:39:44 +01:00
Sebastiaan van Stijn
e6dabfa3b1 client: move resetting mediaType for hijack to where applicable
The mediaType is only used in a single location; reset it in
that location.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-02-04 16:39:44 +01:00
Sebastiaan van Stijn
b0e206b807 client: separate Dialer() implementation from public API
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-02-04 16:39:44 +01:00
Sebastiaan van Stijn
e7da72a464 Merge pull request #49381 from thaJeztah/improve_validation
client: normalize and validate empty ID / name arguments to fail early
2025-02-04 15:49:23 +01:00
Paweł Gronowski
72b835151a Merge pull request #48720 from jsternberg/buildkit-gc-options
builder: wire up new gc types for buildkit prune functionality
2025-02-03 16:55:46 +00:00
Sebastiaan van Stijn
329b2a26f3 client: normalize and validate empty ID / name arguments to fail early
In situations where an empty ID was passed, the client would construct an
invalid API endpoint URL, which either resulted in the "not found" handler
being hit (resulting in a "page not found" error), or even the wrong endpoint
being hit if the client follows redirects.

For example, `/containers/<empty id>/json` (inspect) redirects to `/containers/json`
(docker ps))

Given that empty IDs should never be expected (especially if they're part of
the API URL path), we can validate these and return early.

Its worth noting that a few methods already had an error in place; those
methods were related to the situation mentioned above, where (e.g.) an
"inspect" would redirect to a "list" endpoint. The existing errors, for
convenience, mimicked a "not found" error; this patch changes such errors
to an "Invalid Parameter" instead, which is more correct, but it could be
a breaking change for some edge cases where users parsed the output;

    git grep 'objectNotFoundError{'
    client/config_inspect.go:        return swarm.Config{}, nil, objectNotFoundError{object: "config", id: id}
    client/container_inspect.go:     return container.InspectResponse{}, nil, objectNotFoundError{object: "container", id: containerID}
    client/container_inspect.go:     return container.InspectResponse{}, objectNotFoundError{object: "container", id: containerID}
    client/distribution_inspect.go:  return distributionInspect, objectNotFoundError{object: "distribution", id: imageRef}
    client/image_inspect.go:         return image.InspectResponse{}, nil, objectNotFoundError{object: "image", id: imageID}
    client/network_inspect.go:       return network.Inspect{}, nil, objectNotFoundError{object: "network", id: networkID}
    client/node_inspect.go:          return swarm.Node{}, nil, objectNotFoundError{object: "node", id: nodeID}
    client/plugin_inspect.go:        return nil, nil, objectNotFoundError{object: "plugin", id: name}
    client/secret_inspect.go:        return swarm.Secret{}, nil, objectNotFoundError{object: "secret", id: id}
    client/service_inspect.go:       return swarm.Service{}, nil, objectNotFoundError{object: "service", id: serviceID}
    client/task_inspect.go:          return swarm.Task{}, nil, objectNotFoundError{object: "task", id: taskID}
    client/volume_inspect.go:        return volume.Volume{}, nil, objectNotFoundError{object: "volume", id: volumeID}

Two such errors are still left, as "ID or name" would probably be confusing,
but perhaps we can use a more generic error to include those as well (e.g.
"invalid <object> reference: value is empty");

    client/distribution_inspect.go:  return distributionInspect, objectNotFoundError{object: "distribution", id: imageRef}
    client/image_inspect.go:         return image.InspectResponse{}, nil, objectNotFoundError{object: "image", id: imageID}

Before this patch:

    docker container start ""
    Error response from daemon: page not found
    Error: failed to start containers:

    docker container start " "
    Error response from daemon: No such container:
    Error: failed to start containers:

With this patch:

    docker container start ""
    invalid container name or ID: value is empty
    Error: failed to start containers:

    docker container start " "
    invalid container name or ID: value is empty
    Error: failed to start containers:

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-02-03 11:21:51 +01:00
Sebastiaan van Stijn
30e75b8396 client: improve handling of JSON error-responses with incorrect schema
Before this patch, an API response that's valid JSON, but not the right
schema would be silently discarded by the CLI. For example, due to a bug
in Docker Desktop's API proxy, the "normal" (not JSON error) response
would be returned together with a non-200 status code when using an
unsupported API version;

    curl -s -w 'STATUS: %{http_code}\n' --unix-socket /var/run/docker.sock 'http://localhost/v1.99/version'
    {"Platform":{"Name":"Docker Desktop 4.38.0 (181016)"},"Version":"","ApiVersion":"","GitCommit":"","GoVersion":"","Os":"","Arch":""}
    STATUS: 400

Before this patch, this resulted in no output being shown;

    DOCKER_API_VERSION=1.99 docker version
    Client:
     Version:           27.5.1
     API version:       1.99 (downgraded from 1.47)
     Go version:        go1.22.11
     Git commit:        9f9e405
     Built:             Wed Jan 22 13:37:19 2025
     OS/Arch:           darwin/arm64
     Context:           desktop-linux
    Error response from daemon:

With this patch, an error is generated based on the status:

    DOCKER_API_VERSION=1.99 docker version
    Client:
     Version:           27.5.1
     API version:       1.99 (downgraded from 1.47)
     Go version:        go1.22.11
     Git commit:        9f9e405
     Built:             Wed Jan 22 13:37:19 2025
     OS/Arch:           darwin/arm64
     Context:           desktop-linux
    Error response from daemon: API returned a 400 (Bad Request) but provided no error-message

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-01-30 22:01:13 +01:00
Sebastiaan van Stijn
e7f5d73fa5 Merge pull request #49354 from thaJeztah/client_test_coverage
client: improve test-coverage for error-responses
2025-01-30 17:07:00 +01:00
Sebastiaan van Stijn
5b5ad4df2c Merge pull request #49352 from thaJeztah/api_version_prefix
client: WithVersion: strip v-prefix when setting API version
2025-01-30 17:04:31 +01:00
Jonathan A. Sternberg
8e529682af builder: wire up new gc types for buildkit prune functionality
This wires up the new gc types that buildkit exposes in version 0.17.
The previous flag, `KeepBytes`, was renamed to `ReservedBytes` and two
new options, `MaxUsed` and `MinFree` were added.

`MaxUsed` corresponds to the maximum amount of space that buildkit will
use for the build cache and `MinFree` amount of free disk space for the
system to prevent the cache from using that space. This allows greater
configuration of the cache storage usage when used in situations where
docker is not the only service on the system using disk space.

Signed-off-by: Jonathan A. Sternberg <jonathan.sternberg@docker.com>
2025-01-30 09:54:12 -06:00
Sebastiaan van Stijn
02eb72380f client: remove uses of pkg/errors in tests
While there may be reasons to keep pkg/errors in production
code, we don't need them for these tests.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-01-29 11:53:16 +01:00
Sebastiaan van Stijn
0ca0ccd37a client: improve test-coverage for error-responses
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-01-29 11:47:25 +01:00
Sebastiaan van Stijn
97b50bca2c client: WithVersion: strip v-prefix when setting API version
When overriding the API version through DOCKER_API_VERSION, no validation
happens on the given version. However, some code-paths in the client do
some minor normalizing, and strip the "v" prefix (if present) as part of
[`Client.getAPIPath()`][1].

This resulted in some inconsistent handling of the version that's set. For
example,  [`Client.checkResponseErr()`][2] decides whether or not the API
response is expected to support errors in JSON format (`types.ErrorResponse`),
which would fail because `versions.GreaterThan()` does not strip the prefix,
therefore making the first element "zero" (ranking lower than any valid version).

Net result was "mixed" because of this; for example in the following, half
the output is handled correctly ("downgraded from 1.47"), but the response
is handled as < 1.23 (so printed as-is);

    DOCKER_API_VERSION=v1.23 docker version
    Client: Docker Engine - Community
     Version:           27.5.1
     API version:       v1.23 (downgraded from 1.47)
     Go version:        go1.22.11
     Git commit:        9f9e405
     Built:             Wed Jan 22 13:41:13 2025
     OS/Arch:           linux/amd64
     Context:           default
    Error response from daemon: {"message":"client version 1.23 is too old. Minimum supported API version is 1.24, please upgrade your client to a newer version"}

Passing the version without v-prefix corrects this problem;

    DOCKER_API_VERSION=1.23 docker version
    Client: Docker Engine - Community
     Version:           27.5.1
     API version:       1.99 (downgraded from 1.47)
     Go version:        go1.22.11
     Git commit:        9f9e405
     Built:             Wed Jan 22 13:41:13 2025
     OS/Arch:           linux/amd64
     Context:           default
    Error response from daemon: client version 1.99 is too new. Maximum supported API version is 1.47

    DOCKER_API_VERSION=v1.99 docker version
    Client: Docker Engine - Community
     Version:           27.5.1
     API version:       v1.99 (downgraded from 1.47)
     Go version:        go1.22.11
     Git commit:        9f9e405
     Built:             Wed Jan 22 13:41:13 2025
     OS/Arch:           linux/amd64
     Context:           default
    Error response from daemon: {"message":"client version 1.99 is too new. Maximum supported API version is 1.47"}

This patch strips the prefix when setting a custom version, so that
normalization happens consistently. The existing code to strip the
prefix in [`Client.getAPIPath()`][1] is kept for now, in case values
are set through other ways.

[1]: 47dc8d5dd8/client/client.go (L303-L309)
[2]: 47dc8d5dd8/client/request.go (L231-L241)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-01-28 21:32:23 +01:00
Sebastiaan van Stijn
d61a6924d7 client: use lazyregexp to compile regexes on first use
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2025-01-02 21:37:32 +01:00
Sebastiaan van Stijn
01b98afeb6 Merge pull request #49054 from maggie44/apiversion
Accurately reflect the canonical casing of `API-Version` and `OS-Type` headers
2024-12-16 13:06:31 +01:00
avoidaway
694c01620b chore: fix some function names in comment
Signed-off-by: avoidaway <cmoman@126.com>
2024-12-09 21:05:29 +08:00
maggie44
76a5ca1d4d Accurately reflect the canonical casing of API-Version and OS-Type headers
Go automatically canonicalises HTTP headers, meaning the string `API-Version` passed as a header has always been returned as `Api-Version`. Similarly, `OSType` is returned as `Ostype`.

This commit updates the documentation to reflect this behaviour and modifies the codebase to ensure that input strings are aligned with their canonical output values.

Signed-off-by: maggie44 <64841595+maggie44@users.noreply.github.com>
2024-12-08 22:23:57 +00:00
Aleksa Sarai
557e4ed83b tests: migrate simple cases to assert.ErrorIs
There were a handful of direct checks against errors.Is that can be
translated to assert.ErrorIs without too much thought. Unfortunately
there are a load of other examples where ErrorIs probably makes sense
but would require testing whether this subtly breaks the test.

These transformations were done by hand.

Signed-off-by: Aleksa Sarai <cyphar@cyphar.com>
2024-11-22 23:59:21 +11:00
Sebastiaan van Stijn
e5c2b5e10d Merge pull request #48897 from thaJeztah/client_import_no_empties
client: ImageImport: omit empty query-parameters
2024-11-20 15:27:49 +01:00