Skip to content
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

always output SBOM table #238

Closed
wants to merge 3 commits into from
Closed

Conversation

jonasagx
Copy link

@jonasagx jonasagx commented Apr 5, 2022

Always print SBOM as table, even with file output.

Closes: #46
Signed-off-by: Jonas Galvão Xavier [email protected]

Signed-off-by: Jonas Galvão Xavier <[email protected]>
@jonasagx jonasagx self-assigned this Apr 5, 2022
Signed-off-by: Jonas Galvão Xavier <[email protected]>
@jonasagx jonasagx marked this pull request as draft April 6, 2022 04:29
Signed-off-by: Jonas Galvão Xavier <[email protected]>
@jonasagx jonasagx marked this pull request as ready for review April 6, 2022 05:02
@jonasagx jonasagx requested a review from kzantow April 6, 2022 05:03
@@ -126,7 +126,7 @@ async function executeSyft({
throw new Error("Invalid input, no image or path specified");
}

args = [...args, "-o", format];
args = [...args, "-o", format, "-o", "table"];
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think this is going to work correctly. The way the code currently works, syft is invoked and the stdout captured as the sbom. Looking at the changes in the snapshots, this change seems to have caused multiple types of SBOMs to be output to stdout. Instead, we'd need to do something like syft -o table -o spdx-json=some-file.spdx.json and then instead of using stdout as the sbom, just print stdout to the console as this would have the table output, and then read or otherwise use the sbom file.

Copy link
Author

Choose a reason for hiding this comment

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

Oh I see :) I got it really wrong.

@kzantow
Copy link
Contributor

kzantow commented Apr 6, 2022

We discussed this a while ago, but I'm not actually sure this is especially useful. More useful would be a convert command, if someone really wanted a text version of the SBOM dumped to the logs, it would be a simple script using syft to convert an sbom to the table view.

@jonasagx
Copy link
Author

jonasagx commented Apr 6, 2022

@kzantow agreed, I should have closed that issue (or had it waiting) in favor of the conversion approach.

@jonasagx jonasagx closed this Apr 6, 2022
@jonasagx jonasagx deleted the show-sbom-table branch April 6, 2022 18:27
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.

Print table view when generating output file
2 participants