Skip to content

client: deprecate CommonAPIClient interface, add HijackDialer, SwarmManagementAPIClient interfaces#49388

Merged
thaJeztah merged 7 commits intomoby:masterfrom
thaJeztah:client_unify_interfaces
Feb 4, 2025
Merged

client: deprecate CommonAPIClient interface, add HijackDialer, SwarmManagementAPIClient interfaces#49388
thaJeztah merged 7 commits intomoby:masterfrom
thaJeztah:client_unify_interfaces

Conversation

@thaJeztah
Copy link
Member

integration/internal: JobComplete: require shallower interface

client: separate Dialer() implementation from public API

client: move resetting mediaType for hijack to where applicable

The mediaType is only used in a single location; reset it in
that location.

client: make setupHijackConn a regular function

pass the dialer as argument

client: define separate interface for HijackDialer

client: define interface for all Swarm-specific methods

Introduce a SwarmManagementAPIClient interface that captures
all swarm-specific methods on the API client.

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.

- Human readable description for the release notes

- Go SDK: client: deprecate CommonAPIClient interface in favor of the APIClient interface. The CommonAPIClient will be changed to an alias for APIClient in the next release, and removed in the release after.
- Go SDK: client: add HijackDialer interface
- Go SDK: client: add SwarmManagementAPIClient interface to describe all API client methods related to swarm-specific objects.

- A picture of a cute animal (not mandatory but encouraged)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
The mediaType is only used in a single location; reset it in
that location.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
pass the dialer as argument

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
Introduce a SwarmManagementAPIClient interface that captures
all swarm-specific methods on the API client.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah added status/2-code-review impact/changelog impact/deprecation kind/refactor PR's that refactor, or clean-up code area/go-sdk impact/go-sdk Noteworthy (compatibility changes) in the Go SDK labels Feb 4, 2025
@thaJeztah thaJeztah added this to the 28.0.0 milestone Feb 4, 2025
@thaJeztah thaJeztah self-assigned this Feb 4, 2025
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>
@thaJeztah thaJeztah force-pushed the client_unify_interfaces branch from 7aa103d to 2997c0d Compare February 4, 2025 16:21
@thaJeztah
Copy link
Member Author

Failure is unrelated;

#24 0.052 dockerd: ELF 64-bit LSB executable, 64-bit PowerPC or cisco 7500, OpenPOWER ELF V2 ABI, version 1 (SYSV), statically linked, for GNU/Linux 3.10.0, Go BuildID=byRZjIcfFXLdY4yWQgGS/OdHNQbccEqFDAowp8lJT/sqNetSvAx5IyE9XHbBNK/eFh_0CMQspIOYByIM61T, BuildID[xxHash]=f7bd3cff1105fd85, with debug_info, not stripped
#24 0.052 + dockerd --version
#24 0.122 Segmentation fault (core dumped)
#24 ERROR: process "/bin/sh -c   set -ex\n  file dockerd\n  dockerd --version\n  file docker-proxy\n  docker-proxy --version\n" did not complete successfully: exit code: 139

@thaJeztah thaJeztah merged commit 63ea5dc into moby:master Feb 4, 2025
150 checks passed
@thaJeztah thaJeztah deleted the client_unify_interfaces branch February 4, 2025 21:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/go-sdk impact/changelog impact/deprecation impact/go-sdk Noteworthy (compatibility changes) in the Go SDK kind/refactor PR's that refactor, or clean-up code status/2-code-review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants