Skip to content

Commit bc1c51e

Browse files
committed
refactor: delete ListAllPackages
Since packages are always included and filtered out on the client side, we don't havd to send ListAllPackages to the server. Signed-off-by: knqyf263 <[email protected]>
1 parent 5ff1a3d commit bc1c51e

File tree

6 files changed

+109
-122
lines changed

6 files changed

+109
-122
lines changed

pkg/rpc/client/client.go

-1
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ func (s Scanner) Scan(ctx context.Context, target, artifactKey string, blobKeys
8484
Options: &rpc.ScanOptions{
8585
VulnType: opts.VulnType,
8686
Scanners: xstrings.ToStringSlice(opts.Scanners),
87-
ListAllPackages: opts.ListAllPackages,
8887
LicenseCategories: licenseCategories,
8988
IncludeDevDeps: opts.IncludeDevDeps,
9089
},

pkg/scanner/local/scan_test.go

+2-3
Original file line numberDiff line numberDiff line change
@@ -377,9 +377,8 @@ func TestScanner_Scan(t *testing.T) {
377377
target: "./result.cdx",
378378
layerIDs: []string{"sha256:5216338b40a7b96416b8b9858974bbe4acc3096ee60acbc4dfb1ee02aecceb10"},
379379
options: types.ScanOptions{
380-
VulnType: []string{types.VulnTypeLibrary},
381-
Scanners: types.Scanners{types.VulnerabilityScanner},
382-
ListAllPackages: true,
380+
VulnType: []string{types.VulnTypeLibrary},
381+
Scanners: types.Scanners{types.VulnerabilityScanner},
383382
},
384383
},
385384
fixtures: []string{"testdata/fixtures/happy.yaml"},

pkg/types/scan.go

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ type ScanOptions struct {
2626
Scanners Scanners
2727
ImageConfigScanners Scanners // Scanners for container image configuration
2828
ScanRemovedPackages bool
29-
ListAllPackages bool
3029
LicenseCategories map[types.LicenseCategory][]string
3130
FilePatterns []string
3231
IncludeDevDeps bool

rpc/scanner/service.pb.go

+63-73
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rpc/scanner/service.proto

+2-1
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,10 @@ message Licenses {
2525
message ScanOptions {
2626
repeated string vuln_type = 1;
2727
repeated string scanners = 2;
28-
bool list_all_packages = 3;
2928
map<string, Licenses> license_categories = 4;
3029
bool include_dev_deps = 5;
30+
31+
reserved 3; // deleted 'list_all_packages'
3132
}
3233

3334
message ScanResponse {

0 commit comments

Comments
 (0)