Skip to content

Commit

Permalink
pass in default ranger client if using incognito. (#516)
Browse files Browse the repository at this point in the history
Fixes nil panics if trying to fetch a vuln report when using incognito.
The vuln report requires upstream communication and it does that via the
http client in the UpstreamConfig
  • Loading branch information
preslavgerchev authored Apr 13, 2023
1 parent b639e04 commit 19d3454
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion policy/scan/local_scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ func (s *LocalScanner) HealthCheck(ctx context.Context, req *HealthCheckRequest)

func (s *LocalScanner) getUpstreamConfig(incognito bool, job *Job) (resources.UpstreamConfig, error) {
if incognito {
return resources.UpstreamConfig{Incognito: true}, nil
return resources.UpstreamConfig{Incognito: true, HttpClient: ranger.DefaultHttpClient()}, nil
}

// Make a copy here, we do not want to add to the original plugins map if we're connecting upstream with credentials from a job.
Expand Down

0 comments on commit 19d3454

Please sign in to comment.