Skip to content

Commit

Permalink
fix: load trivy-policies by config (#1928)
Browse files Browse the repository at this point in the history
Signed-off-by: chenk <hen.keinan@gmail.com>
  • Loading branch information
chen-keinan committed Mar 20, 2024
1 parent 72722f4 commit 5aaa7de
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pkg/operator/operator.go
Expand Up @@ -207,9 +207,12 @@ func Start(ctx context.Context, buildInfo trivyoperator.BuildInfo, operatorConfi
return fmt.Errorf("unable to setup scan job reconciler: %w", err)
}
}
policyLoader, err := buildPolicyLoader(trivyOperatorConfig)
if err != nil {
return fmt.Errorf("unable to constract policy loader: %w", err)
var policyLoader policy.Loader
if operatorConfig.ConfigAuditScannerEnabled {
policyLoader, err = buildPolicyLoader(trivyOperatorConfig)
if err != nil {
return fmt.Errorf("unable to constract policy loader: %w", err)
}
}

if operatorConfig.ScannerReportTTL != nil {
Expand Down

0 comments on commit 5aaa7de

Please sign in to comment.