mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 19:56:01 +00:00
Fix conformance test error with log level 8
Fix: #70788 e2e conformance test completely passed with log level 5, but failed only with log level 8.
This commit is contained in:
parent
16d0992534
commit
c0cacd2525
@ -4302,13 +4302,13 @@ func (rt *extractRT) RoundTrip(req *http.Request) (*http.Response, error) {
|
||||
|
||||
// headersForConfig extracts any http client logic necessary for the provided
|
||||
// config.
|
||||
func headersForConfig(c *restclient.Config) (http.Header, error) {
|
||||
func headersForConfig(c *restclient.Config, url *url.URL) (http.Header, error) {
|
||||
extract := &extractRT{}
|
||||
rt, err := restclient.HTTPWrappersForConfig(c, extract)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if _, err := rt.RoundTrip(&http.Request{}); err != nil {
|
||||
if _, err := rt.RoundTrip(&http.Request{URL: url}); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return extract.Header, nil
|
||||
@ -4332,7 +4332,7 @@ func OpenWebSocketForURL(url *url.URL, config *restclient.Config, protocols []st
|
||||
url.Host += ":80"
|
||||
}
|
||||
}
|
||||
headers, err := headersForConfig(config)
|
||||
headers, err := headersForConfig(config, url)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to load http headers: %v", err)
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user