|
|
@ -36,6 +36,8 @@ import (
|
|
|
|
// grpc library default is 4MB
|
|
|
|
// grpc library default is 4MB
|
|
|
|
const maxMsgSize = 1024 * 1024 * 20
|
|
|
|
const maxMsgSize = 1024 * 1024 * 20
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const timeout = 5
|
|
|
|
|
|
|
|
|
|
|
|
// Client manages client side of the Helm-Tiller protocol.
|
|
|
|
// Client manages client side of the Helm-Tiller protocol.
|
|
|
|
type Client struct {
|
|
|
|
type Client struct {
|
|
|
|
opts options
|
|
|
|
opts options
|
|
|
@ -44,8 +46,7 @@ type Client struct {
|
|
|
|
// NewClient creates a new client.
|
|
|
|
// NewClient creates a new client.
|
|
|
|
func NewClient(opts ...Option) *Client {
|
|
|
|
func NewClient(opts ...Option) *Client {
|
|
|
|
var c Client
|
|
|
|
var c Client
|
|
|
|
// set some sane defaults
|
|
|
|
c.Option(ConnectTimeout(timeout))
|
|
|
|
c.Option(ConnectTimeout(5))
|
|
|
|
|
|
|
|
return c.Option(opts...)
|
|
|
|
return c.Option(opts...)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -202,7 +203,7 @@ func (h *Client) GetVersion(opts ...VersionOption) (*rls.GetVersionResponse, err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
req := &rls.GetVersionRequest{}
|
|
|
|
req := &rls.GetVersionRequest{}
|
|
|
|
ctx := NewContext()
|
|
|
|
ctx := NewContext()
|
|
|
|
h.Option(ConnectTimeout(5))
|
|
|
|
h.Option(ConnectTimeout(timeout))
|
|
|
|
|
|
|
|
|
|
|
|
if reqOpts.before != nil {
|
|
|
|
if reqOpts.before != nil {
|
|
|
|
if err := reqOpts.before(ctx, req); err != nil {
|
|
|
|
if err := reqOpts.before(ctx, req); err != nil {
|
|
|
|