Skip to content

Commit dcea3f9

Browse files
authored
Merge pull request #166 from bluesliverx/main
Make sure to explicitly set cache-dir just in case
2 parents 0773bef + e178b5b commit dcea3f9

File tree

2 files changed

+8
-9
lines changed

2 files changed

+8
-9
lines changed

buildrunner/steprunner/tasks/push.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -254,7 +254,10 @@ def _security_scan_trivy(
254254
with open(
255255
os.path.join(local_run_dir, config_file_name), "w", encoding="utf8"
256256
) as fobj:
257-
yaml.safe_dump(security_scan_config.config, fobj)
257+
yaml.safe_dump(
258+
{"cache-dir": container_cache_dir, **security_scan_config.config},
259+
fobj,
260+
)
258261

259262
image_scanner = None
260263
try:

tests/test_push_security_scan.py

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -353,14 +353,10 @@ def _call_run(command, **kwargs):
353353
"config.yaml",
354354
"results.json",
355355
}
356-
assert (
357-
yaml.safe_load((run_path / "config.yaml").read_text())
358-
== security_scan_config.config
359-
)
360-
assert (
361-
yaml.safe_load((run_path / "config.yaml").read_text())
362-
== security_scan_config.config
363-
)
356+
assert yaml.safe_load((run_path / "config.yaml").read_text()) == {
357+
"cache-dir": "/root/.cache/trivy",
358+
**security_scan_config.config,
359+
}
364360

365361
docker_runner_mock.ImageConfig.assert_called_once_with(
366362
"registry1/aquasec/trivy:latest",

0 commit comments

Comments
 (0)