Skip to content

fix: avoid premature tmp cleanup for multi-container scans#2899

Open
mdusher wants to merge 1 commit intoaquasecurity:mainfrom
mdusher:per-container-tmp
Open

fix: avoid premature tmp cleanup for multi-container scans#2899
mdusher wants to merge 1 commit intoaquasecurity:mainfrom
mdusher:per-container-tmp

Conversation

@mdusher
Copy link
Copy Markdown
Contributor

@mdusher mdusher commented Feb 26, 2026

Description

When running trivy-operator in ClientServer mode, ScanJobs will fail due to the temp directory being cleaned up by another container's scan. This causes VulnerabilityReports to either not be generated, or delayed until you are lucky enough for all containers to complete their image scans before a cleanup occurs.

This pull request is based on the patch @daanschipper mentioned in the original issue (daanschipper@1749113) to use per-container tmp volumes when running scans to avoid the premature temp file cleanup.

Related issues

Checklist

  • I've read the guidelines for contributing to this repository.
  • I've added tests that prove my fix is effective or that my feature works.
  • I've updated the documentation with the relevant information (if needed).
  • I've added usage information (if the PR introduces new options)
  • I've included a "before" and "after" example to the description (if the PR is a user interface change).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ScanJobs fail in Trivy Operator Server Mode — all ScanJob pods in Error state, no vulnerabilities detected

1 participant