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>
This function was added in 7405ac5c2d as
a fallback for API < v1.41, which did not include the service status
in the response. Current API versions return this information, so there's
no need to fetch it manually.
It was not gated by API version for some tests (which didn't set API
version), but should not be needed for non-test situations.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Support for API versions < v1.44 was removed in the client in [moby@96b29f5]
and [moby@7652f38], so we can remove fallback-code from the CLI as well,
as it won't be able to use those versions.
[moby@96b29f5]: 96b29f5a1f
[moby@7652f38]: 7652f38c28
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
- fix minor linting issues (unhandled errors)
- rename vars to prevent shadowing
- use sub-tests for tests that already prepared for it
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This warning is better handled by the daemon, where applicable, as
the client does not have all information available to determine
if using a localhost / loopback-address for the DNS is possible.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The ResolveDefaultContext function was exported in [cli@f820766] to allow
(unit) testing, but did not document that it was only exported for this
purpose. The only external use of this function is in buildx, which uses
it in a unit test that can be implemented without this function.
This patch deprecates the function so that we can remove it.
[cli@f820766]: f820766f6a
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
It's just a wrapper around WithAPIClient, and not needed for this
test, which validates that "Initialize" properly creates the context
store, even if a client was already set;
3b26cfce8b
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Support for daemon-side auto-remove was added in API v1.25; on older
versions of the daemon, the client was responsible for removing the
container after it exited (see [moby@6dd8e10])
On API versions < 1.30, it used the events API for this purpose, and
would wait for a "die", "detach" or "detroy" events to know the container
exited, and could be removed or (when attached, but without a TTY) to
get the container's exit-status. (see [cli@38591f2]).
API version 1.24 (docker 1.12) is 9 Years old (July 29, 2016), and API
1.30 (docker 17.06) is 8 Years old (Jun 20, 2017), and long EOL. While
technically, a CLI could negotiate API 1.30 or older, this would only
be in cases where either API version negotiation failed, or the version
was explicitly overridden through `DOCKER_API_VERSION` for testing.
Either of those cases would be rare, and not worth the technical complexity
to support. This patch removes support for AutoRemove on API < 1.30.
[moby@6dd8e10]: 6dd8e10d6e
[cli@38591f2]: 38591f20d0
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The `VirtualSize` field was deprecated in [moby@1261fe6], and omitted / removed
in API v1.44 in [moby@913b0f5], and the corresponding formatting placeholder
was deprecated in [cli@f02301a].
This patch removes the formatting function, which also removes it from the
`docker image ls --format=json` output.
[moby@1261fe6]: 1261fe69a3
[moby@913b0f5]: 913b0f51ca
[cli@f02301a]: f02301ab5d
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Relates to [cli@27b2797], which forked this type from the Moby API, and
[cli@aab947d], which fixed the deprecation comment.
This field is no longer used since Docker 1.11 (API version 1.23) through
[moby@aee260d] and [engine-api@9a9e468], and the fix of the deprecation
comment was included in the 28.4.0 release.
This patch removes the field.
[cli@27b2797]: 27b2797f7d
[cli@aab947d]: aab947de8f
[moby@aee260d]: aee260d4eb
[engine-api@9a9e468]: 9a9e468f50
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This utility was added in 9b83d5bbf9, but
was never used. Remove the utility, and rewrite the error returned to
implement the errdefs.NotFound interface, so that it can be detected
using the errdefs.IsNotFound() utility if needed.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Commit [cli@27b2797] forked the AuthConfig type from the API, and changed
existing code to do a direct cast / convert of the forked type to the API
type. This can cause issues if the API types diverges, such as the removal
of the Email field.
This patch explicitly maps each field to the corresponding API type, but
adds some TODOs, because various code-paths only included a subset of the
fields, which may be intentional for fields that were meant to be handled
on the daemon / registry-client only.
We should evaluate these conversions to make sure these fields should
be sent from the client or not (and possibly even removed from the API
type).
[cli@27b2797]: 27b2797f7d
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This function is a wrapper around apiClient.ImagePull and not directly
related to docker content trust; it just happens to also be called
when using content trust (through the trustedPull utility).
Move it together with the `runPull` function to separate it from
trust-related code.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
This function is a wrapper around apiClient.ImagePull; the use of
trust.ImageRefAndAuth was out of convenience because it's also called
when using content trust (through the trustedPull utility).
Let's pull away the layers to separate it from trust code.
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>