Skip to content

Commit

Permalink
Merge pull request #166 from bluesliverx/main
Browse files Browse the repository at this point in the history
Make sure to explicitly set cache-dir just in case
  • Loading branch information
bluesliverx authored Oct 7, 2024
2 parents 0773bef + e178b5b commit dcea3f9
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 9 deletions.
5 changes: 4 additions & 1 deletion buildrunner/steprunner/tasks/push.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,10 @@ def _security_scan_trivy(
with open(
os.path.join(local_run_dir, config_file_name), "w", encoding="utf8"
) as fobj:
yaml.safe_dump(security_scan_config.config, fobj)
yaml.safe_dump(
{"cache-dir": container_cache_dir, **security_scan_config.config},
fobj,
)

image_scanner = None
try:
Expand Down
12 changes: 4 additions & 8 deletions tests/test_push_security_scan.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,14 +353,10 @@ def _call_run(command, **kwargs):
"config.yaml",
"results.json",
}
assert (
yaml.safe_load((run_path / "config.yaml").read_text())
== security_scan_config.config
)
assert (
yaml.safe_load((run_path / "config.yaml").read_text())
== security_scan_config.config
)
assert yaml.safe_load((run_path / "config.yaml").read_text()) == {
"cache-dir": "/root/.cache/trivy",
**security_scan_config.config,
}

docker_runner_mock.ImageConfig.assert_called_once_with(
"registry1/aquasec/trivy:latest",
Expand Down

0 comments on commit dcea3f9

Please sign in to comment.