From 67222e5fb68d2674dd279d64b0f717b512e34f94 Mon Sep 17 00:00:00 2001 From: Victoria Jeffrey Date: Fri, 15 Sep 2023 14:49:34 -0600 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20scan=20with=20no=20upstrea?= =?UTF-8?q?m=20config=20err?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- providers/arista/provider/provider.go | 2 +- providers/aws/provider/provider.go | 2 +- providers/azure/provider/provider.go | 2 +- providers/equinix/provider/provider.go | 2 +- providers/gcp/provider/provider.go | 2 +- providers/github/provider/provider.go | 2 +- providers/gitlab/provider/provider.go | 2 +- providers/google-workspace/provider/provider.go | 2 +- providers/ipmi/provider/provider.go | 2 +- providers/k8s/provider/provider.go | 2 +- providers/ms365/provider/provider.go | 2 +- providers/network/provider/provider.go | 2 +- providers/oci/provider/provider.go | 2 +- providers/okta/provider/provider.go | 2 +- providers/opcua/provider/provider.go | 2 +- providers/os/provider/provider.go | 2 +- providers/slack/provider/provider.go | 2 +- providers/terraform/provider/provider.go | 2 +- providers/vcd/provider/provider.go | 2 +- providers/vsphere/provider/provider.go | 2 +- 20 files changed, 20 insertions(+), 20 deletions(-) diff --git a/providers/arista/provider/provider.go b/providers/arista/provider/provider.go index 1118f41f23..02678e7c5a 100644 --- a/providers/arista/provider/provider.go +++ b/providers/arista/provider/provider.go @@ -137,7 +137,7 @@ func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallba } var upstream *upstream.UpstreamClient - if req.Upstream != nil { + if req.Upstream != nil && req.Upstream.ApiEndpoint != "" { upstream, err = req.Upstream.InitClient() if err != nil { return nil, err diff --git a/providers/aws/provider/provider.go b/providers/aws/provider/provider.go index 3e03fe9751..558b3f3f86 100644 --- a/providers/aws/provider/provider.go +++ b/providers/aws/provider/provider.go @@ -143,7 +143,7 @@ func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallba } var upstream *upstream.UpstreamClient - if req.Upstream != nil { + if req.Upstream != nil && req.Upstream.ApiEndpoint != "" { upstream, err = req.Upstream.InitClient() if err != nil { return nil, err diff --git a/providers/azure/provider/provider.go b/providers/azure/provider/provider.go index 3e17a6f662..401e1f7d3c 100644 --- a/providers/azure/provider/provider.go +++ b/providers/azure/provider/provider.go @@ -152,7 +152,7 @@ func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallba } var upstream *upstream.UpstreamClient - if req.Upstream != nil { + if req.Upstream != nil && req.Upstream.ApiEndpoint != "" { upstream, err = req.Upstream.InitClient() if err != nil { return nil, err diff --git a/providers/equinix/provider/provider.go b/providers/equinix/provider/provider.go index 5d629d3f3a..5df03d95cd 100644 --- a/providers/equinix/provider/provider.go +++ b/providers/equinix/provider/provider.go @@ -129,7 +129,7 @@ func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallba } var upstream *upstream.UpstreamClient - if req.Upstream != nil { + if req.Upstream != nil && req.Upstream.ApiEndpoint != "" { upstream, err = req.Upstream.InitClient() if err != nil { return nil, err diff --git a/providers/gcp/provider/provider.go b/providers/gcp/provider/provider.go index dc98a11b80..a158617366 100644 --- a/providers/gcp/provider/provider.go +++ b/providers/gcp/provider/provider.go @@ -250,7 +250,7 @@ func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallba } var upstream *upstream.UpstreamClient - if req.Upstream != nil { + if req.Upstream != nil && req.Upstream.ApiEndpoint != "" { upstream, err = req.Upstream.InitClient() if err != nil { return nil, err diff --git a/providers/github/provider/provider.go b/providers/github/provider/provider.go index 69dd72b0ba..22253a08e7 100644 --- a/providers/github/provider/provider.go +++ b/providers/github/provider/provider.go @@ -148,7 +148,7 @@ func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallba } var upstream *upstream.UpstreamClient - if req.Upstream != nil { + if req.Upstream != nil && req.Upstream.ApiEndpoint != "" { upstream, err = req.Upstream.InitClient() if err != nil { return nil, err diff --git a/providers/gitlab/provider/provider.go b/providers/gitlab/provider/provider.go index 195cc7036a..ed9e74c5b0 100644 --- a/providers/gitlab/provider/provider.go +++ b/providers/gitlab/provider/provider.go @@ -124,7 +124,7 @@ func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallba } var upstream *upstream.UpstreamClient - if req.Upstream != nil { + if req.Upstream != nil && req.Upstream.ApiEndpoint != "" { upstream, err = req.Upstream.InitClient() if err != nil { return nil, err diff --git a/providers/google-workspace/provider/provider.go b/providers/google-workspace/provider/provider.go index f81d57061e..db220152c4 100644 --- a/providers/google-workspace/provider/provider.go +++ b/providers/google-workspace/provider/provider.go @@ -179,7 +179,7 @@ func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallba } var upstream *upstream.UpstreamClient - if req.Upstream != nil { + if req.Upstream != nil && req.Upstream.ApiEndpoint != "" { upstream, err = req.Upstream.InitClient() if err != nil { return nil, err diff --git a/providers/ipmi/provider/provider.go b/providers/ipmi/provider/provider.go index f01c0e542f..17138e4744 100644 --- a/providers/ipmi/provider/provider.go +++ b/providers/ipmi/provider/provider.go @@ -138,7 +138,7 @@ func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallba } var upstream *upstream.UpstreamClient - if req.Upstream != nil { + if req.Upstream != nil && req.Upstream.ApiEndpoint != "" { upstream, err = req.Upstream.InitClient() if err != nil { return nil, err diff --git a/providers/k8s/provider/provider.go b/providers/k8s/provider/provider.go index 3351d73fa5..ed2bb725b0 100644 --- a/providers/k8s/provider/provider.go +++ b/providers/k8s/provider/provider.go @@ -168,7 +168,7 @@ func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallba } var upstream *upstream.UpstreamClient - if req.Upstream != nil { + if req.Upstream != nil && req.Upstream.ApiEndpoint != "" { upstream, err = req.Upstream.InitClient() if err != nil { return nil, err diff --git a/providers/ms365/provider/provider.go b/providers/ms365/provider/provider.go index e4c740270a..37e6b3b649 100644 --- a/providers/ms365/provider/provider.go +++ b/providers/ms365/provider/provider.go @@ -125,7 +125,7 @@ func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallba } var upstream *upstream.UpstreamClient - if req.Upstream != nil { + if req.Upstream != nil && req.Upstream.ApiEndpoint != "" { upstream, err = req.Upstream.InitClient() if err != nil { return nil, err diff --git a/providers/network/provider/provider.go b/providers/network/provider/provider.go index 939ac8ef6d..52921dfb21 100644 --- a/providers/network/provider/provider.go +++ b/providers/network/provider/provider.go @@ -143,7 +143,7 @@ func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallba } var upstream *upstream.UpstreamClient - if req.Upstream != nil { + if req.Upstream != nil && req.Upstream.ApiEndpoint != "" { upstream, err = req.Upstream.InitClient() if err != nil { return nil, err diff --git a/providers/oci/provider/provider.go b/providers/oci/provider/provider.go index fdefe3af50..6b98ab1d95 100644 --- a/providers/oci/provider/provider.go +++ b/providers/oci/provider/provider.go @@ -157,7 +157,7 @@ func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallba } var upstream *upstream.UpstreamClient - if req.Upstream != nil { + if req.Upstream != nil && req.Upstream.ApiEndpoint != "" { upstream, err = req.Upstream.InitClient() if err != nil { return nil, err diff --git a/providers/okta/provider/provider.go b/providers/okta/provider/provider.go index 188f3e5048..cd5d201314 100644 --- a/providers/okta/provider/provider.go +++ b/providers/okta/provider/provider.go @@ -137,7 +137,7 @@ func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallba } var upstream *upstream.UpstreamClient - if req.Upstream != nil { + if req.Upstream != nil && req.Upstream.ApiEndpoint != "" { upstream, err = req.Upstream.InitClient() if err != nil { return nil, err diff --git a/providers/opcua/provider/provider.go b/providers/opcua/provider/provider.go index b47b92bc55..6cd38e22f6 100644 --- a/providers/opcua/provider/provider.go +++ b/providers/opcua/provider/provider.go @@ -113,7 +113,7 @@ func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallba } var upstream *upstream.UpstreamClient - if req.Upstream != nil { + if req.Upstream != nil && req.Upstream.ApiEndpoint != "" { upstream, err = req.Upstream.InitClient() if err != nil { return nil, err diff --git a/providers/os/provider/provider.go b/providers/os/provider/provider.go index 03f819cab6..be6c976cd8 100644 --- a/providers/os/provider/provider.go +++ b/providers/os/provider/provider.go @@ -301,7 +301,7 @@ func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallba } var upstream *upstream.UpstreamClient - if req.Upstream != nil { + if req.Upstream != nil && req.Upstream.ApiEndpoint != "" { upstream, err = req.Upstream.InitClient() if err != nil { return nil, err diff --git a/providers/slack/provider/provider.go b/providers/slack/provider/provider.go index 2b7988a90a..b816f3fdbc 100644 --- a/providers/slack/provider/provider.go +++ b/providers/slack/provider/provider.go @@ -114,7 +114,7 @@ func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallba } var upstream *upstream.UpstreamClient - if req.Upstream != nil { + if req.Upstream != nil && req.Upstream.ApiEndpoint != "" { upstream, err = req.Upstream.InitClient() if err != nil { return nil, err diff --git a/providers/terraform/provider/provider.go b/providers/terraform/provider/provider.go index 48705c275d..2835c370bc 100644 --- a/providers/terraform/provider/provider.go +++ b/providers/terraform/provider/provider.go @@ -159,7 +159,7 @@ func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallba } var upstream *upstream.UpstreamClient - if req.Upstream != nil { + if req.Upstream != nil && req.Upstream.ApiEndpoint != "" { upstream, err = req.Upstream.InitClient() if err != nil { return nil, err diff --git a/providers/vcd/provider/provider.go b/providers/vcd/provider/provider.go index 24c76f9067..765f0093b9 100644 --- a/providers/vcd/provider/provider.go +++ b/providers/vcd/provider/provider.go @@ -127,7 +127,7 @@ func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallba } var upstream *upstream.UpstreamClient - if req.Upstream != nil { + if req.Upstream != nil && req.Upstream.ApiEndpoint != "" { upstream, err = req.Upstream.InitClient() if err != nil { return nil, err diff --git a/providers/vsphere/provider/provider.go b/providers/vsphere/provider/provider.go index 60684b56fb..f573d2a137 100644 --- a/providers/vsphere/provider/provider.go +++ b/providers/vsphere/provider/provider.go @@ -140,7 +140,7 @@ func (s *Service) connect(req *plugin.ConnectReq, callback plugin.ProviderCallba } var upstream *upstream.UpstreamClient - if req.Upstream != nil { + if req.Upstream != nil && req.Upstream.ApiEndpoint != "" { upstream, err = req.Upstream.InitClient() if err != nil { return nil, err