Unverified Commit d08e68e7 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #65849 from CaoShuFeng/debuggingRoundTripper

Automatic merge from submit-queue (batch tested with PRs 65771, 65849). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>. fix kube-aggregator dailer Fixes: https://github.com/kubernetes/kubernetes/issues/65848 **What this PR does / why we need it**: **Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*: Fixes # **Special notes for your reviewer**: **Release note**: ```release-note NONE ```
parents d2cc34fb dc07d27d
...@@ -18,7 +18,6 @@ package apiserver ...@@ -18,7 +18,6 @@ package apiserver
import ( import (
"context" "context"
"fmt"
"net/http" "net/http"
"net/url" "net/url"
"sync/atomic" "sync/atomic"
...@@ -208,15 +207,12 @@ func (r *proxyHandler) updateAPIService(apiService *apiregistrationapi.APIServic ...@@ -208,15 +207,12 @@ func (r *proxyHandler) updateAPIService(apiService *apiregistrationapi.APIServic
serviceNamespace: apiService.Spec.Service.Namespace, serviceNamespace: apiService.Spec.Service.Namespace,
serviceAvailable: apiregistrationapi.IsAPIServiceConditionTrue(apiService, apiregistrationapi.Available), serviceAvailable: apiregistrationapi.IsAPIServiceConditionTrue(apiService, apiregistrationapi.Available),
} }
if r.proxyTransport != nil && r.proxyTransport.DialContext != nil {
newInfo.restConfig.Dial = r.proxyTransport.DialContext
}
newInfo.proxyRoundTripper, newInfo.transportBuildingError = restclient.TransportFor(newInfo.restConfig) newInfo.proxyRoundTripper, newInfo.transportBuildingError = restclient.TransportFor(newInfo.restConfig)
if newInfo.transportBuildingError == nil && r.proxyTransport != nil && r.proxyTransport.DialContext != nil { if newInfo.transportBuildingError != nil {
switch transport := newInfo.proxyRoundTripper.(type) {
case *http.Transport:
transport.DialContext = r.proxyTransport.DialContext
default:
newInfo.transportBuildingError = fmt.Errorf("unable to set dialer for %s/%s as rest transport is of type %T", apiService.Spec.Service.Namespace, apiService.Spec.Service.Name, newInfo.proxyRoundTripper)
glog.Warning(newInfo.transportBuildingError.Error()) glog.Warning(newInfo.transportBuildingError.Error())
} }
}
r.handlingInfo.Store(newInfo) r.handlingInfo.Store(newInfo)
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment