Skip to content

Fix Trivy template compatibility and bump Go to 1.26.5 - #565

Merged
soloio-bulldozer[bot] merged 2 commits into
mainfrom
chandler/trivy072fix
Aug 3, 2026
Merged

Fix Trivy template compatibility and bump Go to 1.26.5#565
soloio-bulldozer[bot] merged 2 commits into
mainfrom
chandler/trivy072fix

Conversation

@chandler-solo

Copy link
Copy Markdown
Contributor

Summary

  • Create temporary Trivy templates with the required .tpl extension.
  • Clean up temporary files when writing or closing them fails.
  • Add regression coverage for the template filename and contents.
  • Clean up temporary templates created by the scanner tests.
  • Pin PR integration tests to Trivy v0.72.0 instead of dynamically installing the latest release.
  • Bump Go from 1.26.1 to 1.26.5.

Root cause

Trivy v0.70.0 began requiring custom template filenames to end in .tpl. GetTemplateFile created an extensionless temporary file, causing scans with newer Trivy versions to fail before scanning any images.

The scanner retried the invalid invocation and eventually returned an Unrecoverable error, preventing downstream security-alert issues from being created or updated.

Validation

  • Ran go mod verify.
  • Ran go test ./securityscanutils.
  • Confirmed the tests use Go 1.26.5.
  • Validated the new changelog entry.
  • Ran git diff --check.

Follow-up

Consumers should upgrade to the resulting go-utils release before updating their pinned Trivy version to v0.70.0 or later.

## Summary

- Create temporary Trivy templates with the required `.tpl` extension.
- Clean up temporary files when writing or closing them fails.
- Add regression coverage for the template filename and contents.
- Clean up temporary templates created by the scanner tests.
- Bump Go from 1.26.1 to 1.26.5.

## Root cause

Trivy v0.70.0 began requiring custom template filenames to end in `.tpl`. `GetTemplateFile` created an extensionless temporary file, causing scans with newer Trivy versions to fail before scanning any images.

The scanner retried the invalid invocation and eventually returned an `Unrecoverable` error, preventing downstream security-alert issues from being created or updated.

## Validation

- Ran `go mod verify`.
- Ran `go test ./securityscanutils`.
- Confirmed the tests use Go 1.26.5.
- Validated the new changelog entry.
- Ran `git diff --check`.

## Follow-up

Consumers should upgrade to the resulting `go-utils` release before updating their pinned Trivy version to v0.70.0 or later.

Signed-off-by: David L. Chandler <david.chandler@solo.io>
Signed-off-by: David L. Chandler <david.chandler@solo.io>
@soloio-bulldozer
soloio-bulldozer Bot merged commit 901ce14 into main Aug 3, 2026
6 checks passed
@soloio-bulldozer
soloio-bulldozer Bot deleted the chandler/trivy072fix branch August 3, 2026 21:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants