aquasecurity / trivy

Find vulnerabilities, misconfigurations, secrets, SBOM in containers, Kubernetes, code repositories, clouds and more
https://aquasecurity.github.io/trivy
Apache License 2.0
23.1k stars 2.28k forks source link

refactor: replace global cache directory with parameter passing #6986

Closed knqyf263 closed 3 months ago

knqyf263 commented 3 months ago

Description

This PR addresses using a global variable to store the cache directory path referenced by various packages. The global state is known to be prone to unintended modifications and makes changes difficult to track. Instead, the cache directory path is now passed as a parameter to propagate the value throughout the codebase.

Checklist

DmitriyLewen commented 3 months ago

@knqyf263 can you fix windows test, please