Skip to content

Commit

Permalink
feat: return error for option combination, leading to incomplete results
Browse files Browse the repository at this point in the history
Signed-off-by: knqyf263 <[email protected]>
  • Loading branch information
knqyf263 committed Jul 26, 2024
1 parent 4839d3d commit aaea1ea
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
3 changes: 0 additions & 3 deletions docs/docs/scanner/vulnerability.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,9 +304,6 @@ By default, all relationships are included in the scan.
!!! info
This flag filters the packages themselves, so it also affects the `--list-all-pkgs` option and SBOM generation.
!!! warning
As it may not provide a complete package list, it can lead to incomplete dependency trees when using `--dependency-tree` or generate incomplete SBOMs.
[^1]: https://github.com/GoogleContainerTools/distroless
Expand Down
2 changes: 1 addition & 1 deletion pkg/flag/options.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ func (o *Options) Align(f *Flags) error {
if f.PackageFlagGroup != nil && f.PackageFlagGroup.PkgRelationships != nil &&
slices.Compare(o.PkgRelationships, ftypes.Relationships) != 0 &&
(o.DependencyTree || slices.Contains(types.SupportedSBOMFormats, o.Format) || o.VEXPath != "") {

Check failure on line 377 in pkg/flag/options.go

View workflow job for this annotation

GitHub Actions / Integration Test

o.VEXPath undefined (type *Options has no field or method VEXPath)

Check failure on line 377 in pkg/flag/options.go

View workflow job for this annotation

GitHub Actions / K8s Integration Test

o.VEXPath undefined (type *Options has no field or method VEXPath)

Check failure on line 377 in pkg/flag/options.go

View workflow job for this annotation

GitHub Actions / VM Integration Test

o.VEXPath undefined (type *Options has no field or method VEXPath)
log.Warn("Using '--pkg-relationships' may affect features that rely on package dependency information, such as SBOM relationships, dependency trees, and VEX filtering.")
return xerrors.Errorf("'--pkg-relationships' cannot be used with '--dependency-tree', '--vex' or SBOM formats")
}

if o.Compliance.Spec.ID != "" {
Expand Down

0 comments on commit aaea1ea

Please sign in to comment.