diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2021-07-28 16:17:45 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-28 16:17:45 +0200 |
commit | f9395ddc5ad8b32e4e9b24542f0869722f7c9743 (patch) | |
tree | 49b13967ee2b4d00f4f9fe0886fb50888d89270a /pkg/bindings/connection.go | |
parent | 1bf7a9ed9cf8cd18793c11084138ee2b1b2a5365 (diff) | |
parent | 4df6e31ccbad8dd7800e413a0377fa0d1a0774ce (diff) | |
download | podman-f9395ddc5ad8b32e4e9b24542f0869722f7c9743.tar.gz podman-f9395ddc5ad8b32e4e9b24542f0869722f7c9743.tar.bz2 podman-f9395ddc5ad8b32e4e9b24542f0869722f7c9743.zip |
Merge pull request #11067 from vrothberg/fix-10154-2
remote build: fix streaming and error handling
Diffstat (limited to 'pkg/bindings/connection.go')
-rw-r--r-- | pkg/bindings/connection.go | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/pkg/bindings/connection.go b/pkg/bindings/connection.go index fd93c5ac7..62b1655ac 100644 --- a/pkg/bindings/connection.go +++ b/pkg/bindings/connection.go @@ -327,7 +327,7 @@ func (c *Connection) DoRequest(httpBody io.Reader, httpMethod, endpoint string, uri := fmt.Sprintf("http://d/v%d.%d.%d/libpod"+endpoint, params...) logrus.Debugf("DoRequest Method: %s URI: %v", httpMethod, uri) - req, err := http.NewRequest(httpMethod, uri, httpBody) + req, err := http.NewRequestWithContext(context.WithValue(context.Background(), clientKey, c), httpMethod, uri, httpBody) if err != nil { return nil, err } @@ -337,7 +337,6 @@ func (c *Connection) DoRequest(httpBody io.Reader, httpMethod, endpoint string, for key, val := range header { req.Header.Set(key, val) } - req = req.WithContext(context.WithValue(context.Background(), clientKey, c)) // Give the Do three chances in the case of a comm/service hiccup for i := 0; i < 3; i++ { response, err = c.Client.Do(req) // nolint |