Browse code

client: remove unused Client.HTTPClient() method

This method was introduced in [moby@5a84124] related to the (now removed)
support for "compose on kubernetes" in the CLI. This functionality extended
the CLI with endpoints that are not part of the engine API, but re-using
the HTTP-client with the same (TLS) config as the CLI itself.

While such scenarios may be something to consider in future (i.e. more easily
extend the API with custom endpoints), this method is not currently used,
but defined as part of the CLI's interface. This patch removes the method
for now, so that we can design from a clean slate in case we need this
extensibility, instead of keeping methods that were added ad-hoc around.

[moby@5a84124]: https://github.com/moby/moby/commit/5a84124739a809bcdb5830fd385440027ddd910f

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>

Sebastiaan van Stijn authored on 2025/09/20 00:06:04
Showing 4 changed files
... ...
@@ -381,12 +381,6 @@ func (cli *Client) DaemonHost() string {
381 381
 	return cli.host
382 382
 }
383 383
 
384
-// HTTPClient returns a copy of the HTTP client bound to the server
385
-func (cli *Client) HTTPClient() *http.Client {
386
-	c := *cli.client
387
-	return &c
388
-}
389
-
390 384
 // ParseHostURL parses a url string, validates the string is a host url, and
391 385
 // returns the parsed URL
392 386
 func ParseHostURL(host string) (*url.URL, error) {
... ...
@@ -4,7 +4,6 @@ import (
4 4
 	"context"
5 5
 	"io"
6 6
 	"net"
7
-	"net/http"
8 7
 
9 8
 	"github.com/moby/moby/api/types"
10 9
 	"github.com/moby/moby/api/types/build"
... ...
@@ -38,7 +37,6 @@ type stableAPIClient interface {
38 38
 	VolumeAPIClient
39 39
 	ClientVersion() string
40 40
 	DaemonHost() string
41
-	HTTPClient() *http.Client
42 41
 	ServerVersion(ctx context.Context) (types.Version, error)
43 42
 	NegotiateAPIVersion(ctx context.Context)
44 43
 	NegotiateAPIVersionPing(types.Ping)
... ...
@@ -381,12 +381,6 @@ func (cli *Client) DaemonHost() string {
381 381
 	return cli.host
382 382
 }
383 383
 
384
-// HTTPClient returns a copy of the HTTP client bound to the server
385
-func (cli *Client) HTTPClient() *http.Client {
386
-	c := *cli.client
387
-	return &c
388
-}
389
-
390 384
 // ParseHostURL parses a url string, validates the string is a host url, and
391 385
 // returns the parsed URL
392 386
 func ParseHostURL(host string) (*url.URL, error) {
... ...
@@ -4,7 +4,6 @@ import (
4 4
 	"context"
5 5
 	"io"
6 6
 	"net"
7
-	"net/http"
8 7
 
9 8
 	"github.com/moby/moby/api/types"
10 9
 	"github.com/moby/moby/api/types/build"
... ...
@@ -38,7 +37,6 @@ type stableAPIClient interface {
38 38
 	VolumeAPIClient
39 39
 	ClientVersion() string
40 40
 	DaemonHost() string
41
-	HTTPClient() *http.Client
42 41
 	ServerVersion(ctx context.Context) (types.Version, error)
43 42
 	NegotiateAPIVersion(ctx context.Context)
44 43
 	NegotiateAPIVersionPing(types.Ping)