Support configurable default platform in the client.

Signed-off-by: Lantao Liu <lantaol@google.com>
This commit is contained in:
Lantao Liu
2019-08-31 18:04:08 -07:00
parent b039c39186
commit 555cb31fd9
9 changed files with 28 additions and 16 deletions

View File

@@ -99,6 +99,12 @@ func New(address string, opts ...ClientOpt) (*Client, error) {
c.runtime = defaults.DefaultRuntime
}
if copts.defaultPlatform != nil {
c.platform = copts.defaultPlatform
} else {
c.platform = platforms.Default()
}
if copts.services != nil {
c.services = *copts.services
}
@@ -193,6 +199,7 @@ type Client struct {
conn *grpc.ClientConn
runtime string
defaultns string
platform platforms.MatchComparer
connector func() (*grpc.ClientConn, error)
}