refactor: pass DB dir to trivy-db (#7057)

Signed-off-by: knqyf263 <knqyf263@gmail.com>
This commit is contained in:
Teppei Fukuda
2024-07-02 08:32:46 +04:00
committed by GitHub
parent 6a307bb389
commit fc6b3a760b
13 changed files with 91 additions and 90 deletions

View File

@@ -76,7 +76,7 @@ func cleanScanCache(ctx context.Context, opts flag.Options) error {
func cleanVulnerabilityDB(ctx context.Context, opts flag.Options) error {
log.InfoContext(ctx, "Removing vulnerability database...")
if err := db.NewClient(opts.CacheDir, true).Clear(ctx); err != nil {
if err := db.NewClient(db.Dir(opts.CacheDir), true).Clear(ctx); err != nil {
return xerrors.Errorf("clear vulnerability database: %w", err)
}