mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-21 23:00:42 -08:00
feat(flag): add exit-on-eosl option (#3423)
Co-authored-by: knqyf263 <knqyf263@gmail.com>
This commit is contained in:
@@ -454,6 +454,7 @@ func Run(ctx context.Context, opts flag.Options, targetKind TargetKind) (err err
|
||||
return xerrors.Errorf("report error: %w", err)
|
||||
}
|
||||
|
||||
exitOnEosl(opts, report.Metadata)
|
||||
Exit(opts, report.Results.Failed())
|
||||
|
||||
return nil
|
||||
@@ -663,6 +664,12 @@ func Exit(opts flag.Options, failedResults bool) {
|
||||
}
|
||||
}
|
||||
|
||||
func exitOnEosl(opts flag.Options, m types.Metadata) {
|
||||
if opts.ReportOptions.ExitOnEOSL && m.OS != nil && m.OS.Eosl {
|
||||
Exit(opts, true)
|
||||
}
|
||||
}
|
||||
|
||||
func canonicalVersion(ver string) string {
|
||||
if ver == devVersion {
|
||||
return ver
|
||||
|
||||
Reference in New Issue
Block a user