From 3f5210f3544f996d72a96d930d24ef768bc78016 Mon Sep 17 00:00:00 2001 From: Frankie Gallina-Jones Date: Tue, 13 Sep 2022 15:54:41 -0400 Subject: [PATCH] rename RpmdbMetadata --> RpmMetadata to match upstream --- .../formats/cyclonedx13/cyclonedxhelpers/component_test.go | 6 +++--- .../formats/cyclonedx13/cyclonedxhelpers/publisher.go | 2 +- .../formats/cyclonedx13/cyclonedxhelpers/publisher_test.go | 2 +- sbom/internal/formats/syft2/model/package.go | 4 ++-- sbom/internal/formats/syft301/model/package.go | 4 ++-- 5 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sbom/internal/formats/cyclonedx13/cyclonedxhelpers/component_test.go b/sbom/internal/formats/cyclonedx13/cyclonedxhelpers/component_test.go index f7372b5e..3fc1412b 100644 --- a/sbom/internal/formats/cyclonedx13/cyclonedxhelpers/component_test.go +++ b/sbom/internal/formats/cyclonedx13/cyclonedxhelpers/component_test.go @@ -109,8 +109,8 @@ func Test_encodeComponentProperties(t *testing.T) { Name: "dive", Version: "0.9.2-1", Type: pkg.RpmPkg, - MetadataType: pkg.RpmdbMetadataType, - Metadata: pkg.RpmdbMetadata{ + MetadataType: pkg.RpmMetadataType, + Metadata: pkg.RpmMetadata{ Name: "dive", Epoch: &epoch, Arch: "x86_64", @@ -124,7 +124,7 @@ func Test_encodeComponentProperties(t *testing.T) { }, }, expected: &[]cyclonedx.Property{ - {Name: "syft:package:metadataType", Value: "RpmdbMetadata"}, + {Name: "syft:package:metadataType", Value: "RpmMetadata"}, {Name: "syft:package:type", Value: "rpm"}, {Name: "syft:metadata:epoch", Value: "2"}, {Name: "syft:metadata:release", Value: "1"}, diff --git a/sbom/internal/formats/cyclonedx13/cyclonedxhelpers/publisher.go b/sbom/internal/formats/cyclonedx13/cyclonedxhelpers/publisher.go index 045053c3..c4153f8f 100644 --- a/sbom/internal/formats/cyclonedx13/cyclonedxhelpers/publisher.go +++ b/sbom/internal/formats/cyclonedx13/cyclonedxhelpers/publisher.go @@ -9,7 +9,7 @@ func encodePublisher(p pkg.Package) string { switch metadata := p.Metadata.(type) { case pkg.ApkMetadata: return metadata.Maintainer - case pkg.RpmdbMetadata: + case pkg.RpmMetadata: return metadata.Vendor case pkg.DpkgMetadata: return metadata.Maintainer diff --git a/sbom/internal/formats/cyclonedx13/cyclonedxhelpers/publisher_test.go b/sbom/internal/formats/cyclonedx13/cyclonedxhelpers/publisher_test.go index 03e69db2..06730598 100644 --- a/sbom/internal/formats/cyclonedx13/cyclonedxhelpers/publisher_test.go +++ b/sbom/internal/formats/cyclonedx13/cyclonedxhelpers/publisher_test.go @@ -31,7 +31,7 @@ func Test_encodePublisher(t *testing.T) { { name: "from rpm", input: pkg.Package{ - Metadata: pkg.RpmdbMetadata{ + Metadata: pkg.RpmMetadata{ Vendor: "auth", }, }, diff --git a/sbom/internal/formats/syft2/model/package.go b/sbom/internal/formats/syft2/model/package.go index e4793c2f..4251fd47 100644 --- a/sbom/internal/formats/syft2/model/package.go +++ b/sbom/internal/formats/syft2/model/package.go @@ -69,8 +69,8 @@ func (p *Package) UnmarshalJSON(b []byte) error { return err } p.Metadata = payload - case pkg.RpmdbMetadataType: - var payload pkg.RpmdbMetadata + case pkg.RpmMetadataType: + var payload pkg.RpmMetadata if err := json.Unmarshal(unpacker.Metadata, &payload); err != nil { return err } diff --git a/sbom/internal/formats/syft301/model/package.go b/sbom/internal/formats/syft301/model/package.go index 8ae1f005..e0497d14 100644 --- a/sbom/internal/formats/syft301/model/package.go +++ b/sbom/internal/formats/syft301/model/package.go @@ -70,8 +70,8 @@ func (p *Package) UnmarshalJSON(b []byte) error { return err } p.Metadata = payload - case pkg.RpmdbMetadataType: - var payload pkg.RpmdbMetadata + case pkg.RpmMetadataType: + var payload pkg.RpmMetadata if err := json.Unmarshal(unpacker.Metadata, &payload); err != nil { return err }