Skip to content

Commit 711e271

Browse files
committed
Keep Package for b/c
Signed-off-by: Jose Fuentes <[email protected]>
1 parent 968f379 commit 711e271

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

api/report.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@ type Report struct {
1010
Timestamp Time `json:"timestamp"`
1111
// Cluster indicates which was the target of the report.
1212
Cluster string `json:"cluster"`
13-
// Package indicates which package was used for the report.
14-
Package Package `json:"package"`
13+
// Package indicates which package was used for the report. (deprecated)
14+
Package string `json:"package"`
15+
// PackageInformation contains all the information about the package that was used to generate the report.
16+
PackageInformation Package `json:"package-information"`
1517
// Name is the name of the package that was used for this report.
1618
Name string `json:"name"`
1719
// Description is the description of the package that was used for this report.

pkg/exporter/json.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,8 @@ func (e *JSONExporter) Export(ctx context.Context, policyManifest *packaging.Pol
2525
report := api.Report{
2626
// TODO: we are omitting ID, Timestamp and Cluster for now, but it will get fixed with #1
2727
PreflightVersion: version.PreflightVersion,
28-
Package: api.Package{
28+
Package: policyManifest.ID,
29+
PackageInformation: api.Package{
2930
Namespace: policyManifest.Namespace,
3031
ID: policyManifest.ID,
3132
Version: policyManifest.PackageVersion,

pkg/exporter/json_test.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@ func TestJSONExport(t *testing.T) {
158158
],
159159
"description": "This is a test package.",
160160
"name": "Test Package",
161-
"package": {
161+
"package": "test-pkg",
162+
"package-information": {
162163
"id": "test-pkg",
163164
"namespace": "test.org",
164165
"version": "1.2.3"

0 commit comments

Comments
 (0)