summaryrefslogtreecommitdiff
path: root/vendor/github.com/fsouza/go-dockerclient/client.go
diff options
context:
space:
mode:
authorValentin Rothberg <rothberg@redhat.com>2020-10-26 11:35:02 +0100
committerValentin Rothberg <rothberg@redhat.com>2020-10-29 15:06:22 +0100
commit65a618886efc48562e5b9ff99ca630c83622419b (patch)
tree09d19a7f6fe596a1b9e19fec6e45288f2b76de5a /vendor/github.com/fsouza/go-dockerclient/client.go
parentcce6c6cd40137c460f173300b36c5868383870c5 (diff)
downloadpodman-65a618886efc48562e5b9ff99ca630c83622419b.tar.gz
podman-65a618886efc48562e5b9ff99ca630c83622419b.tar.bz2
podman-65a618886efc48562e5b9ff99ca630c83622419b.zip
new "image" mount type
Add a new "image" mount type to `--mount`. The source of the mount is the name or ID of an image. The destination is the path inside the container. Image mounts further support an optional `rw,readwrite` parameter which if set to "true" will yield the mount writable inside the container. Note that no changes are propagated to the image mount on the host (which in any case is read only). Mounts are overlay mounts. To support read-only overlay mounts, vendor a non-release version of Buildah. Signed-off-by: Valentin Rothberg <rothberg@redhat.com>
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() {