-
Notifications
You must be signed in to change notification settings - Fork 802
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Split up error messages for missing --sbom related flags #5288
Conversation
return options, fmt.Errorf("sbom configuration missing one or more of (%q or %q)", "--sbom-scanner-image", "--sbom-scanner-command") | ||
} | ||
if options.SBOMOutput == "" && options.ImageSBOMOutput == "" && options.PURLOutput == "" && options.ImagePURLOutput == "" { | ||
return options, fmt.Errorf("sbom configuration missing one or more of (%q, %q, %q or %q)", "--sbom-output", "--sbom-image-output", "--sbom-purl-output", "--sbom-image-purl-output") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this if
triggers, it's missing "all" of the options, not "one or more" as you say here. Or did you mean to make som the &&
be ||
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least one of them needs to be specified, but it's fine if any of them are while the rest aren't. I'm not sure how best to word that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can;'t we just pick a default, and maybe allow it to be configured in containers.conf?
Split up the diagnostic for missing SBOM generation settings so that we can more easily tell the difference between "you didn't tell me where to put the output files" and "I don't know how to generate things". [NO NEW TESTS NEEDED] Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
/approve |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: nalind, rhatdan The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
LGTM |
/hold cancel |
/lgtm |
What type of PR is this?
/kind other
What this PR does / why we need it:
Split up the diagnostic for missing SBOM generation settings so that we can more easily tell the difference between "you didn't tell me where to put the output files" and "I don't know how to generate things".
How to verify it
Use
--sbom
and forget to specify options for where to save the generated files, and wonder if the presets aren't working right.Which issue(s) this PR fixes:
None
Special notes for your reviewer:
Not really a bug, but I've confused myself enough times that this probably needed to be changed.
Does this PR introduce a user-facing change?