Fix stutter between the package name and the function
parent
6384a2294e
commit
6fe614efa7
|
@ -111,8 +111,8 @@ func isValidEnv(env string) bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
// SetNoProxyK8s takes a k8s config and upadates the proxy
|
// UpdateConfigTranport takes a k8s rest config and returns a config without a proxy.
|
||||||
func SetNoProxyK8s(cfg *rest.Config) *rest.Config {
|
func UpdateConfigTranport(cfg *rest.Config) *rest.Config {
|
||||||
wt := cfg.WrapTransport // Config might already have a transport wrapper
|
wt := cfg.WrapTransport // Config might already have a transport wrapper
|
||||||
cfg.WrapTransport = func(rt http.RoundTripper) http.RoundTripper {
|
cfg.WrapTransport = func(rt http.RoundTripper) http.RoundTripper {
|
||||||
if wt != nil {
|
if wt != nil {
|
||||||
|
|
|
@ -85,7 +85,7 @@ func (*K8sClientGetter) GetClientset(timeout time.Duration) (*kubernetes.Clients
|
||||||
return nil, fmt.Errorf("Error creating kubeConfig: %v", err)
|
return nil, fmt.Errorf("Error creating kubeConfig: %v", err)
|
||||||
}
|
}
|
||||||
clientConfig.Timeout = timeout
|
clientConfig.Timeout = timeout
|
||||||
clientConfig = proxy.SetNoProxyK8s(clientConfig)
|
clientConfig = proxy.UpdateConfigTranport(clientConfig)
|
||||||
client, err := kubernetes.NewForConfig(clientConfig)
|
client, err := kubernetes.NewForConfig(clientConfig)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrap(err, "Error creating new client from kubeConfig.ClientConfig()")
|
return nil, errors.Wrap(err, "Error creating new client from kubeConfig.ClientConfig()")
|
||||||
|
|
|
@ -77,7 +77,7 @@ func GetClient() (kubernetes.Interface, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("Error creating kubeConfig: %v", err)
|
return nil, fmt.Errorf("Error creating kubeConfig: %v", err)
|
||||||
}
|
}
|
||||||
config = proxy.SetNoProxyK8s(config)
|
config = proxy.UpdateConfigTranport(config)
|
||||||
client, err := kubernetes.NewForConfig(config)
|
client, err := kubernetes.NewForConfig(config)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, errors.Wrap(err, "Error creating new client from kubeConfig.ClientConfig()")
|
return nil, errors.Wrap(err, "Error creating new client from kubeConfig.ClientConfig()")
|
||||||
|
|
Loading…
Reference in New Issue