Allow override of kubeconfig dialer

k3s-v1.13.4
Darren Shepherd 2018-10-09 14:41:20 -07:00
parent e443b5ca54
commit 754bcac0fc
1 changed files with 8 additions and 0 deletions

View File

@ -76,6 +76,10 @@ import (
const etcdRetryLimit = 60
const etcdRetryInterval = 1 * time.Second
var (
DefaultProxyDialerFn utilnet.DialFunc
)
// NewAPIServerCommand creates a *cobra.Command object with default parameters
func NewAPIServerCommand(stopCh <-chan struct{}) *cobra.Command {
s := options.NewServerRunOptions()
@ -160,6 +164,10 @@ func CreateServerChain(completedOptions completedServerRunOptions, stopCh <-chan
return nil, nil, err
}
if DefaultProxyDialerFn != nil {
completedOptions.KubeletConfig.Dial = DefaultProxyDialerFn
}
kubeAPIServerConfig, insecureServingInfo, serviceResolver, pluginInitializer, admissionPostStartHook, err := CreateKubeAPIServerConfig(completedOptions, proxyTransport)
if err != nil {
return nil, nil, err