mirror of https://github.com/k3s-io/k3s
Allow override of kubeconfig dialer
parent
ae595d76e6
commit
0b9b53b31b
|
@ -77,6 +77,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()
|
||||
|
@ -161,6 +165,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
|
||||
|
|
Loading…
Reference in New Issue