diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-08-28 08:23:59 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-28 08:23:59 -0400 |
commit | 74bdf52c401dd1c9cd3c636d4fa8ea94e7c88ef3 (patch) | |
tree | af0904e9ec643dea2caa8d39a55764adc38c069f /vendor/k8s.io/apimachinery/pkg/util/httpstream/spdy/roundtripper.go | |
parent | 061c93f70101026d79cca6e75ac0c565e1fa99ec (diff) | |
parent | 90a86cad3a6f007c6708406d8a78528fbb302a0a (diff) | |
download | podman-74bdf52c401dd1c9cd3c636d4fa8ea94e7c88ef3.tar.gz podman-74bdf52c401dd1c9cd3c636d4fa8ea94e7c88ef3.tar.bz2 podman-74bdf52c401dd1c9cd3c636d4fa8ea94e7c88ef3.zip |
Merge pull request #7472 from containers/dependabot/go_modules/k8s.io/apimachinery-0.19.0
Bump k8s.io/apimachinery from 0.18.8 to 0.19.0
Diffstat (limited to 'vendor/k8s.io/apimachinery/pkg/util/httpstream/spdy/roundtripper.go')
-rw-r--r-- | vendor/k8s.io/apimachinery/pkg/util/httpstream/spdy/roundtripper.go | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/vendor/k8s.io/apimachinery/pkg/util/httpstream/spdy/roundtripper.go b/vendor/k8s.io/apimachinery/pkg/util/httpstream/spdy/roundtripper.go index 2699597e7..6309fbc26 100644 --- a/vendor/k8s.io/apimachinery/pkg/util/httpstream/spdy/roundtripper.go +++ b/vendor/k8s.io/apimachinery/pkg/util/httpstream/spdy/roundtripper.go @@ -76,19 +76,20 @@ var _ utilnet.TLSClientConfigHolder = &SpdyRoundTripper{} var _ httpstream.UpgradeRoundTripper = &SpdyRoundTripper{} var _ utilnet.Dialer = &SpdyRoundTripper{} -// NewRoundTripper creates a new SpdyRoundTripper that will use -// the specified tlsConfig. -func NewRoundTripper(tlsConfig *tls.Config, followRedirects, requireSameHostRedirects bool) httpstream.UpgradeRoundTripper { - return NewSpdyRoundTripper(tlsConfig, followRedirects, requireSameHostRedirects) +// NewRoundTripper creates a new SpdyRoundTripper that will use the specified +// tlsConfig. +func NewRoundTripper(tlsConfig *tls.Config, followRedirects, requireSameHostRedirects bool) *SpdyRoundTripper { + return NewRoundTripperWithProxy(tlsConfig, followRedirects, requireSameHostRedirects, utilnet.NewProxierWithNoProxyCIDR(http.ProxyFromEnvironment)) } -// NewSpdyRoundTripper creates a new SpdyRoundTripper that will use -// the specified tlsConfig. This function is mostly meant for unit tests. -func NewSpdyRoundTripper(tlsConfig *tls.Config, followRedirects, requireSameHostRedirects bool) *SpdyRoundTripper { +// NewRoundTripperWithProxy creates a new SpdyRoundTripper that will use the +// specified tlsConfig and proxy func. +func NewRoundTripperWithProxy(tlsConfig *tls.Config, followRedirects, requireSameHostRedirects bool, proxier func(*http.Request) (*url.URL, error)) *SpdyRoundTripper { return &SpdyRoundTripper{ tlsConfig: tlsConfig, followRedirects: followRedirects, requireSameHostRedirects: requireSameHostRedirects, + proxier: proxier, } } @@ -116,11 +117,7 @@ func (s *SpdyRoundTripper) Dial(req *http.Request) (net.Conn, error) { // dial dials the host specified by req, using TLS if appropriate, optionally // using a proxy server if one is configured via environment variables. func (s *SpdyRoundTripper) dial(req *http.Request) (net.Conn, error) { - proxier := s.proxier - if proxier == nil { - proxier = utilnet.NewProxierWithNoProxyCIDR(http.ProxyFromEnvironment) - } - proxyURL, err := proxier(req) + proxyURL, err := s.proxier(req) if err != nil { return nil, err } |