瀏覽代碼

Merge pull request #33253 from dave-tucker/clientHost

client: Expose ClientHost to client users
Sebastiaan van Stijn 8 年之前
父節點
當前提交
ab2abb0d94
共有 2 個文件被更改,包括 7 次插入0 次删除
  1. 6 0
      client/client.go
  2. 1 0
      client/interface.go

+ 6 - 0
client/client.go

@@ -247,6 +247,12 @@ func (cli *Client) UpdateClientVersion(v string) {
 
 }
 
+// DaemonHost returns the host associated with this instance of the Client.
+// This operation doesn't acquire a mutex.
+func (cli *Client) DaemonHost() string {
+	return cli.host
+}
+
 // ParseHost verifies that the given host strings is valid.
 func ParseHost(host string) (string, string, string, error) {
 	protoAddrParts := strings.SplitN(host, "://", 2)

+ 1 - 0
client/interface.go

@@ -31,6 +31,7 @@ type CommonAPIClient interface {
 	SystemAPIClient
 	VolumeAPIClient
 	ClientVersion() string
+	DaemonHost() string
 	ServerVersion(ctx context.Context) (types.Version, error)
 	UpdateClientVersion(v string)
 }