Skip to content

Commit

Permalink
Rename UseJobCredentials to AllowJobCredentials.
Browse files Browse the repository at this point in the history
Signed-off-by: Preslav <[email protected]>
  • Loading branch information
preslavgerchev committed Nov 24, 2022
1 parent 916341a commit 2fb1267
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions policy/scan/local_scanner.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ type LocalScanner struct {
fetcher *fetcher

// allows setting the upstream credentials from a job
useJobCredentials bool
allowJobCredentials bool
// for remote connectivity
apiEndpoint string
spaceMrn string
Expand All @@ -66,9 +66,9 @@ func WithPlugins(plugins []ranger.ClientPlugin) ScannerOption {
}
}

func EnableJobCredentials() ScannerOption {
func AllowJobCredentials() ScannerOption {
return func(s *LocalScanner) {
s.useJobCredentials = true
s.allowJobCredentials = true
}
}

Expand Down Expand Up @@ -476,9 +476,9 @@ func (s *LocalScanner) getUpstreamConfig(incognito bool, job *Job) resources.Ups
plugins := s.plugins
endpoint := s.apiEndpoint
spaceMrn := s.spaceMrn
jobCredentials := job.Inventory.Spec.UpstreamCredentals

if s.useJobCredentials && jobCredentials != nil {
jobCredentials := job.Inventory.Spec.UpstreamCredentals
if s.allowJobCredentials && jobCredentials != nil {
certAuth, _ := upstream.NewServiceAccountRangerPlugin(jobCredentials)
plugins = append(plugins, certAuth)
endpoint = jobCredentials.GetApiEndpoint()
Expand Down

0 comments on commit 2fb1267

Please sign in to comment.