Skip to content

Commit

Permalink
small code improvement.
Browse files Browse the repository at this point in the history
  • Loading branch information
preslavgerchev committed Sep 21, 2023
1 parent 2977ee3 commit fe59930
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions explorer/scan/local_scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,12 @@ func (s *LocalScanner) Run(ctx context.Context, job *Job) (*explorer.ReportColle
// returns the upstream config for the job. If the job has a specified config, it has precedence
// over the automatically detected one
func (s *LocalScanner) getUpstreamConfig(inv *inventory.Inventory, incognito bool) (*upstream.UpstreamConfig, error) {
if s.upstream == nil && inv.Spec.GetUpstreamCredentials() == nil {
jobCreds := inv.GetSpec().GetUpstreamCredentials()
if s.upstream == nil && jobCreds == nil {
return nil, errors.New("no default or job upstream config provided")
}
u := proto.Clone(s.upstream).(*upstream.UpstreamConfig)
u.Incognito = incognito
jobCreds := inv.GetSpec().GetUpstreamCredentials()
if jobCreds != nil {
u.ApiEndpoint = jobCreds.GetApiEndpoint()
u.Creds = jobCreds
Expand Down

0 comments on commit fe59930

Please sign in to comment.