Skip to content

Commit

Permalink
feat: rename variable in trivyAnalyzer lock
Browse files Browse the repository at this point in the history
Signed-off-by: michael12312 <[email protected]>
  • Loading branch information
michael12312 committed Aug 13, 2024
1 parent 2eeb751 commit ceed247
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/integration/trivy/analyzer.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ type TrivyAnalyzer struct {
configAuditReportAnalysis bool
}

var l sync.RWMutex
var rwMutex sync.RWMutex

func (TrivyAnalyzer) analyzeVulnerabilityReports(a common.Analyzer) ([]common.Result, error) {
// Get all trivy VulnerabilityReports
result := &v1alpha1.VulnerabilityReportList{}

client := a.Client.CtrlClient
l.Lock()
rwMutex.Lock()
err := v1alpha1.AddToScheme(client.Scheme())
l.Unlock()
rwMutex.Unlock()
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -94,9 +94,9 @@ func (t TrivyAnalyzer) analyzeConfigAuditReports(a common.Analyzer) ([]common.Re
result := &v1alpha1.ConfigAuditReportList{}

client := a.Client.CtrlClient
l.Lock()
rwMutex.Lock()
err := v1alpha1.AddToScheme(client.Scheme())
l.Unlock()
rwMutex.Unlock()
if err != nil {
return nil, err
}
Expand Down

0 comments on commit ceed247

Please sign in to comment.