Skip to content

Commit

Permalink
Add proxy to validate rest config
Browse files Browse the repository at this point in the history
  • Loading branch information
jakefhyde committed Sep 27, 2022
1 parent 6a89e30 commit 7a0853f
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pkg/k8splan/watcher.go
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,8 @@ func validateKC(ctx context.Context, config *rest.Config) error {
}

config.Transport = utilnet.SetTransportDefaults(&http.Transport{
DialTLS: func(network, addr string) (net.Conn, error) {
Proxy: http.ProxyFromEnvironment,
DialTLSContext: func(_ context.Context, network, addr string) (net.Conn, error) {
conn, err = tls.Dial(network, addr, tlsConfig)
return conn, err
},
Expand All @@ -403,6 +404,7 @@ func validateKC(ctx context.Context, config *rest.Config) error {
if config.UserAgent == "" {
config.UserAgent = rest.DefaultKubernetesUserAgent()
}

rest, err := rest.UnversionedRESTClientFor(config)
if err != nil {
return err
Expand Down

0 comments on commit 7a0853f

Please sign in to comment.