зеркало из https://github.com/Azure/ARO-RP.git
Prevent memory leaks with DialContext usage and new k8s client creation (#3090)
This commit is contained in:
Родитель
082e9a5a0f
Коммит
36df0152cf
|
@ -8,7 +8,9 @@ import (
|
|||
"errors"
|
||||
"fmt"
|
||||
"net"
|
||||
"net/http"
|
||||
|
||||
machnet "k8s.io/apimachinery/pkg/util/net"
|
||||
"k8s.io/client-go/rest"
|
||||
"k8s.io/client-go/tools/clientcmd"
|
||||
|
||||
|
@ -42,6 +44,10 @@ func RestConfig(dialer proxy.Dialer, oc *api.OpenShiftCluster) (*rest.Config, er
|
|||
|
||||
restconfig.Dial = DialContext(dialer, oc)
|
||||
|
||||
// https://github.com/kubernetes/kubernetes/issues/118703#issuecomment-1595072383
|
||||
// TODO: Revert or adapt when upstream fix is available
|
||||
restconfig.Proxy = machnet.NewProxierWithNoProxyCIDR(http.ProxyFromEnvironment)
|
||||
|
||||
return restconfig, nil
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче