summaryrefslogtreecommitdiff
path: root/vendor/github.com/fsouza/go-dockerclient/client.go
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/github.com/fsouza/go-dockerclient/client.go')
-rw-r--r--vendor/github.com/fsouza/go-dockerclient/client.go22
1 files changed, 12 insertions, 10 deletions
diff --git a/vendor/github.com/fsouza/go-dockerclient/client.go b/vendor/github.com/fsouza/go-dockerclient/client.go
index b176e86bd..a1bccd68f 100644
--- a/vendor/github.com/fsouza/go-dockerclient/client.go
+++ b/vendor/github.com/fsouza/go-dockerclient/client.go
@@ -317,7 +317,7 @@ func NewVersionedTLSClientFromBytes(endpoint string, certPEMBlock, keyPEMBlock,
return nil, err
}
}
- tlsConfig := &tls.Config{}
+ tlsConfig := &tls.Config{MinVersion: tls.VersionTLS12}
if certPEMBlock != nil && keyPEMBlock != nil {
tlsCert, err := tls.X509KeyPair(certPEMBlock, keyPEMBlock)
if err != nil {
@@ -541,7 +541,16 @@ func (c *Client) streamURL(method, url string, streamOptions streamOptions) erro
return err
}
}
- req, err := http.NewRequest(method, url, streamOptions.in)
+
+ // make a sub-context so that our active cancellation does not affect parent
+ ctx := streamOptions.context
+ if ctx == nil {
+ ctx = context.Background()
+ }
+ subCtx, cancelRequest := context.WithCancel(ctx)
+ defer cancelRequest()
+
+ req, err := http.NewRequestWithContext(ctx, method, url, streamOptions.in)
if err != nil {
return err
}
@@ -562,14 +571,6 @@ func (c *Client) streamURL(method, url string, streamOptions streamOptions) erro
streamOptions.stderr = ioutil.Discard
}
- // make a sub-context so that our active cancellation does not affect parent
- ctx := streamOptions.context
- if ctx == nil {
- ctx = context.Background()
- }
- subCtx, cancelRequest := context.WithCancel(ctx)
- defer cancelRequest()
-
if protocol == unixProtocol || protocol == namedPipeProtocol {
var dial net.Conn
dial, err = c.Dialer.Dial(protocol, address)
@@ -958,6 +959,7 @@ func queryString(opts interface{}) string {
}
func addQueryStringValue(items url.Values, key string, v reflect.Value) bool {
+ //nolint:exhaustive
switch v.Kind() {
case reflect.Bool:
if v.Bool() {