Skip to content

client: Expose ClientHost to client users#33253

Merged
thaJeztah merged 1 commit intomoby:masterfrom
dave-tucker:clientHost
May 22, 2017
Merged

client: Expose ClientHost to client users#33253
thaJeztah merged 1 commit intomoby:masterfrom
dave-tucker:clientHost

Conversation

@dave-tucker
Copy link
Contributor

- What I did

Added a new ClientHost() function to the Client interface to return the host that the client is communicating with.

- How I did it

This exposes the private host field that was already a part of the Client struct

- How to verify it

It was verified as working in #32966
I've now re-opened this against as docker/cli#93 - this is the moby-side portion of the changes.

- Description for the changelog

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

client/client.go Outdated
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess this was named for consistency with ClientVersion, but Host would be better, I think.
(Or DaemonHost? )

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I had my doubts about the name as well, but couldn't come up with a good one. Host sounds good to me (or DaemonHost) :D

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DaemonHost sounds better to me.

This commit exposes `Client.host` as `Client.DaemonHost()`
This allows users of the client, a CLI for example, to query the Host
that the client is attempting to contact and vary their behaviour
accordingly. For example, to allow client-side configuration of
HTTP proxy settings for a number of different docker hosts.

Signed-off-by: Dave Tucker <[email protected]>
@dave-tucker
Copy link
Contributor Author

Updated to use DaemonHost. Host is also fine with me.

Copy link
Member

@AkihiroSuda AkihiroSuda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Contributor

@boaz0 boaz0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

Copy link
Member

@thaJeztah thaJeztah left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@thaJeztah thaJeztah merged commit ab2abb0 into moby:master May 22, 2017
@GordonTheTurtle GordonTheTurtle added this to the 17.06.0 milestone May 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants