Skip to content

Commit

Permalink
🐛 do not use upstream when incognito is active (#110)
Browse files Browse the repository at this point in the history
fixes issue reported by @arlimus where `cnspec scan local -f
policy/examples/example.mql.yaml` has failed when upstream was defined.
  • Loading branch information
chris-rock authored Oct 16, 2022
1 parent f9d98bf commit 8416591
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions policy/scan/local_scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,8 +270,8 @@ func (s *LocalScanner) runMotorizedAsset(job *AssetJob) (*AssetReport, error) {
var policyErr error

runtimeErr := inmemory.WithDb(s.resolvedPolicyCache, func(db *inmemory.Db, services *policy.LocalServices) error {
if s.apiEndpoint != "" {
log.Info().Msg("using API endpoint " + s.apiEndpoint)
if s.apiEndpoint != "" && !job.Incognito {
log.Debug().Msg("using API endpoint " + s.apiEndpoint)
upstream, err := policy.NewRemoteServices(s.apiEndpoint, s.plugins)
if err != nil {
return err
Expand Down

0 comments on commit 8416591

Please sign in to comment.