mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-21 14:50:53 -08:00
fix(cli): pass integer to exit-on-eol (#3716)
This commit is contained in:
@@ -457,7 +457,7 @@ func Run(ctx context.Context, opts flag.Options, targetKind TargetKind) (err err
|
||||
return xerrors.Errorf("report error: %w", err)
|
||||
}
|
||||
|
||||
exitOnEosl(opts, report.Metadata)
|
||||
exitOnEOL(opts, report.Metadata)
|
||||
Exit(opts, report.Results.Failed())
|
||||
|
||||
return nil
|
||||
@@ -668,9 +668,10 @@ 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 exitOnEOL(opts flag.Options, m types.Metadata) {
|
||||
if opts.ExitOnEOL != 0 && m.OS != nil && m.OS.Eosl {
|
||||
log.Logger.Errorf("Detected EOL OS: %s %s", m.OS.Family, m.OS.Name)
|
||||
os.Exit(opts.ExitOnEOL)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user