From 196b71b780c088e7d50dc59160074401ec595eaf Mon Sep 17 00:00:00 2001 From: Fabio Graetz Date: Fri, 13 Oct 2023 03:15:44 +0000 Subject: [PATCH] Check for proxy command != nil and len > 0 Signed-off-by: Fabio Graetz --- flyteidl/clients/go/admin/auth_interceptor.go | 2 +- flyteidl/clients/go/admin/client.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/flyteidl/clients/go/admin/auth_interceptor.go b/flyteidl/clients/go/admin/auth_interceptor.go index c8023d688c..09391df67a 100644 --- a/flyteidl/clients/go/admin/auth_interceptor.go +++ b/flyteidl/clients/go/admin/auth_interceptor.go @@ -109,7 +109,7 @@ func setHTTPClientContext(ctx context.Context, cfg *Config, proxyCredentialsFutu transport.Proxy = http.ProxyURL(&cfg.HTTPProxyURL.URL) } - if len(cfg.ProxyCommand) > 0 { + if cfg.ProxyCommand != nil && len(cfg.ProxyCommand) > 0 { httpClient.Transport = &proxyAuthTransport{ transport: transport, proxyCredentialsFuture: proxyCredentialsFuture, diff --git a/flyteidl/clients/go/admin/client.go b/flyteidl/clients/go/admin/client.go index fd7e2860ba..69c3542367 100644 --- a/flyteidl/clients/go/admin/client.go +++ b/flyteidl/clients/go/admin/client.go @@ -153,7 +153,7 @@ func NewAdminConnection(ctx context.Context, cfg *Config, proxyCredentialsFuture opts = append(opts, GetAdditionalAdminClientConfigOptions(cfg)...) - if len(cfg.ProxyCommand) > 0 { + if cfg.ProxyCommand != nil && len(cfg.ProxyCommand) > 0 { opts = append(opts, grpc.WithChainUnaryInterceptor(NewProxyAuthInterceptor(cfg, proxyCredentialsFuture))) opts = append(opts, grpc.WithPerRPCCredentials(proxyCredentialsFuture)) }