Skip to content

Commit

Permalink
⭐️ define proto for cnspec report
Browse files Browse the repository at this point in the history
  • Loading branch information
chris-rock committed Apr 3, 2024
1 parent 316689b commit b1d07b3
Show file tree
Hide file tree
Showing 13 changed files with 690 additions and 23 deletions.
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ prep/tools/mockgen:

# 🌙 MQL/MOTOR #

cnquery/generate: clean/proto llx/generate shared/generate providers explorer/generate sbom/generate
cnquery/generate: clean/proto llx/generate shared/generate providers explorer/generate sbom/generate reporter/generate

cnquery/generate/core: clean/proto llx/generate shared/generate providers/proto providers/build/mock providers/build/core explorer/generate sbom/generate

Expand Down Expand Up @@ -557,6 +557,9 @@ explorer/generate:
sbom/generate:
go generate ./sbom

reporter/generate:
go generate ./cli/reporter

# 🏗 Binary / Build #

.PHONY: cnquery/build
Expand Down
2 changes: 1 addition & 1 deletion apps/cnquery/cmd/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ func (c *cnqueryPlugin) RunQuery(conf *run.RunQueryConfig, runtime *providers.Ru
if conf.Format != "json" {
sh.PrintResults(code, results)
} else {
reporter.BundleResultsToJSON(code, results, out)
_ = reporter.CodeBundleToJSON(code, results, out)
if len(discoveredAssets.Assets) != i+1 {
out.WriteString(",")
}
Expand Down
2 changes: 1 addition & 1 deletion apps/cnquery/cmd/sbom.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ var sbomCmdRun = func(cmd *cobra.Command, runtime *providers.Runtime, cliRes *pl

buf := bytes.Buffer{}
w := shared.IOWriter{Writer: &buf}
err = reporter.ReportCollectionToJSON(report, &w)
err = reporter.ConvertToJSON(report, &w)
if err == nil {
logger.DebugDumpJSON("mondoo-sbom-report", buf.Bytes())
}
Expand Down
Loading

0 comments on commit b1d07b3

Please sign in to comment.