mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-28 14:07:14 +00:00
fix kube-aggregator dailer
This commit is contained in:
parent
afcc156806
commit
dc07d27d8b
@ -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
|
|||||||
serviceNamespace: apiService.Spec.Service.Namespace,
|
serviceNamespace: apiService.Spec.Service.Namespace,
|
||||||
serviceAvailable: apiregistrationapi.IsAPIServiceConditionTrue(apiService, apiregistrationapi.Available),
|
serviceAvailable: apiregistrationapi.IsAPIServiceConditionTrue(apiService, apiregistrationapi.Available),
|
||||||
}
|
}
|
||||||
newInfo.proxyRoundTripper, newInfo.transportBuildingError = restclient.TransportFor(newInfo.restConfig)
|
if r.proxyTransport != nil && r.proxyTransport.DialContext != nil {
|
||||||
if newInfo.transportBuildingError == nil && r.proxyTransport != nil && r.proxyTransport.DialContext != nil {
|
newInfo.restConfig.Dial = r.proxyTransport.DialContext
|
||||||
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())
|
|
||||||
}
|
}
|
||||||
|
newInfo.proxyRoundTripper, newInfo.transportBuildingError = restclient.TransportFor(newInfo.restConfig)
|
||||||
|
if newInfo.transportBuildingError != nil {
|
||||||
|
glog.Warning(newInfo.transportBuildingError.Error())
|
||||||
}
|
}
|
||||||
r.handlingInfo.Store(newInfo)
|
r.handlingInfo.Store(newInfo)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user