Skip to content

fix: use --pkg-types instead of deprecated --vuln-type for trivy - #1223

Merged
sozercan merged 2 commits into
eraser-dev:mainfrom
jiashun0011:jiashunliu/vuln-type-fix
Jul 30, 2026
Merged

fix: use --pkg-types instead of deprecated --vuln-type for trivy#1223
sozercan merged 2 commits into
eraser-dev:mainfrom
jiashun0011:jiashunliu/vuln-type-fix

Conversation

@jiashun0011

Copy link
Copy Markdown
Contributor

What this PR does / why we need it:
Trivy deprecated the --vuln-type flag in v0.54.0 in favor of --pkg-types. Since eraser pins trivy 0.67.2, every scan emits:
WARN '--vuln-type' is deprecated. Use '--pkg-types' instead.

Which issue(s) this PR fixes (optional, using fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when the PR gets merged):
Fixes #

Special notes for your reviewer:

@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 8.33333% with 22 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...ollers/imagecollector/imagecollector_controller.go 0.00% 13 Missing ⚠️
test/e2e/util/utils.go 0.00% 5 Missing ⚠️
test/e2e/util/kubectl.go 0.00% 4 Missing ⚠️
Flag Coverage Δ
unittests 3.87% <8.33%> (-10.97%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
pkg/scanners/trivy/types.go 30.15% <100.00%> (-8.68%) ⬇️
...party/open-policy-agent/gatekeeper/helmify/main.go 0.00% <ø> (ø)
test/e2e/util/kubectl.go 0.00% <0.00%> (ø)
test/e2e/util/utils.go 8.27% <0.00%> (+0.56%) ⬆️
...ollers/imagecollector/imagecollector_controller.go 0.00% <0.00%> (ø)

... and 37 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@sozercan sozercan left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. thanks

@sozercan

Copy link
Copy Markdown
Member

@jiashun0011 looks like its missing dco, please sign when you get a chance

Trivy deprecated the --vuln-type flag in v0.54.0 in favor of --pkg-types.
Since eraser pins trivy 0.67.2, every scan emits:
  WARN '--vuln-type' is deprecated. Use '--pkg-types' instead.

Rename the internal flag constant and update tests. The user-facing
VulnConfig.Types field (JSON: vulnerabilities.types) is unchanged, so
existing eraser configurations continue to work.

Signed-off-by: Jiashun Liu <jiashunliu@microsoft.com>
@jiashun0011
jiashun0011 force-pushed the jiashunliu/vuln-type-fix branch from 59b5bda to 695ad31 Compare July 30, 2026 07:11
Signed-off-by: Sertac Ozercan <sozercan@gmail.com>
@sozercan
sozercan merged commit 6c66089 into eraser-dev:main Jul 30, 2026
91 of 93 checks passed
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