mirror of
https://github.com/aquasecurity/trivy.git
synced 2025-12-23 07:29:00 -08:00
feat!: add clean subcommand (#6993)
Signed-off-by: knqyf263 <knqyf263@gmail.com> Co-authored-by: DmitriyLewen <91113035+DmitriyLewen@users.noreply.github.com> Co-authored-by: DmitriyLewen <dmitriy.lewen@smartforce.io>
This commit is contained in:
@@ -19,17 +19,13 @@ func Run(ctx context.Context, opts flag.Options) (err error) {
|
||||
log.InitLogger(opts.Debug, opts.Quiet)
|
||||
|
||||
// configure cache dir
|
||||
cacheClient, err := cache.NewClient(opts.CacheDir, opts.CacheOptions.CacheBackendOptions)
|
||||
cacheClient, err := cache.New(opts.CacheDir, opts.CacheOptions.CacheBackendOptions)
|
||||
if err != nil {
|
||||
return xerrors.Errorf("server cache error: %w", err)
|
||||
}
|
||||
defer cacheClient.Close()
|
||||
log.Debug("Cache", log.String("dir", opts.CacheDir))
|
||||
|
||||
if opts.Reset {
|
||||
return cacheClient.Reset()
|
||||
}
|
||||
|
||||
// download the database file
|
||||
if err = operation.DownloadDB(ctx, opts.AppVersion, opts.CacheDir, opts.DBRepository,
|
||||
true, opts.SkipDBUpdate, opts.RegistryOpts()); err != nil {
|
||||
|
||||
Reference in New Issue
Block a user