From 62df204bb4447330203a5683e16a3fdf239938e5 Mon Sep 17 00:00:00 2001 From: vjeffrey Date: Sun, 17 Sep 2023 22:10:33 -0600 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20scan=20with=20no=20upstrea?= =?UTF-8?q?m=20config=20err=20(#1744)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- apps/provider-scaffold/template/provider/provider.go.template | 2 +- 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 +- 21 files changed, 21 insertions(+), 21 deletions(-) diff --git a/apps/provider-scaffold/template/provider/provider.go.template b/apps/provider-scaffold/template/provider/provider.go.template index 269eeac962..fbaeb635b8 100644 --- a/apps/provider-scaffold/template/provider/provider.go.template +++ b/apps/provider-scaffold/template/provider/provider.go.template @@ -97,7 +97,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.Incognito { upstream, err = req.Upstream.InitClient() if err != nil { return nil, err diff --git a/providers/arista/provider/provider.go b/providers/arista/provider/provider.go index 01a51161e3..3f9dd82b54 100644 --- a/providers/arista/provider/provider.go +++ b/providers/arista/provider/provider.go @@ -141,7 +141,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.Incognito { 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 7351b1b75d..f900f26ff3 100644 --- a/providers/aws/provider/provider.go +++ b/providers/aws/provider/provider.go @@ -154,7 +154,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.Incognito { 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 f77f143438..2bd0e1a24f 100644 --- a/providers/azure/provider/provider.go +++ b/providers/azure/provider/provider.go @@ -156,7 +156,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.Incognito { 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 c68ec31129..2cfc0140ab 100644 --- a/providers/equinix/provider/provider.go +++ b/providers/equinix/provider/provider.go @@ -133,7 +133,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.Incognito { 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 c08204fd98..d7b01a80e6 100644 --- a/providers/gcp/provider/provider.go +++ b/providers/gcp/provider/provider.go @@ -254,7 +254,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.Incognito { 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 7530a1455c..74efd2259d 100644 --- a/providers/github/provider/provider.go +++ b/providers/github/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.Incognito { 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 1a96f7b36d..00ce40e77c 100644 --- a/providers/gitlab/provider/provider.go +++ b/providers/gitlab/provider/provider.go @@ -128,7 +128,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.Incognito { 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 722941e22d..32bbb16e29 100644 --- a/providers/google-workspace/provider/provider.go +++ b/providers/google-workspace/provider/provider.go @@ -183,7 +183,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.Incognito { 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 49dd6b01c1..441ee2d2fc 100644 --- a/providers/ipmi/provider/provider.go +++ b/providers/ipmi/provider/provider.go @@ -142,7 +142,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.Incognito { 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 924e58f8ed..7739b16146 100644 --- a/providers/k8s/provider/provider.go +++ b/providers/k8s/provider/provider.go @@ -172,7 +172,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.Incognito { 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 ccef931608..40a81bfa85 100644 --- a/providers/ms365/provider/provider.go +++ b/providers/ms365/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.Incognito { 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 a1fecc805e..92191bbd55 100644 --- a/providers/network/provider/provider.go +++ b/providers/network/provider/provider.go @@ -147,7 +147,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.Incognito { 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 944749a112..40df435256 100644 --- a/providers/oci/provider/provider.go +++ b/providers/oci/provider/provider.go @@ -161,7 +161,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.Incognito { 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 348d866d08..48dc560590 100644 --- a/providers/okta/provider/provider.go +++ b/providers/okta/provider/provider.go @@ -141,7 +141,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.Incognito { 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 f9430c3e14..528f41cc8a 100644 --- a/providers/opcua/provider/provider.go +++ b/providers/opcua/provider/provider.go @@ -116,7 +116,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.Incognito { 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 f52b71a0e1..f51ff9f9af 100644 --- a/providers/os/provider/provider.go +++ b/providers/os/provider/provider.go @@ -330,7 +330,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.Incognito { 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 f95f8e5663..670332f175 100644 --- a/providers/slack/provider/provider.go +++ b/providers/slack/provider/provider.go @@ -118,7 +118,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.Incognito { 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 9a93606bf5..e3e52c4bf3 100644 --- a/providers/terraform/provider/provider.go +++ b/providers/terraform/provider/provider.go @@ -163,7 +163,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.Incognito { 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 0f6c3335e7..a3dcf424ee 100644 --- a/providers/vcd/provider/provider.go +++ b/providers/vcd/provider/provider.go @@ -131,7 +131,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.Incognito { 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 4578a07fe6..e9d69692c1 100644 --- a/providers/vsphere/provider/provider.go +++ b/providers/vsphere/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.Incognito { upstream, err = req.Upstream.InitClient() if err != nil { return nil, err