diff --git a/syft/pkg/cataloger/redhat/package.go b/syft/pkg/cataloger/redhat/package.go index 23954991a..8bbcfe9a0 100644 --- a/syft/pkg/cataloger/redhat/package.go +++ b/syft/pkg/cataloger/redhat/package.go @@ -89,6 +89,9 @@ func packageURL(name, arch string, epoch *int, srpm string, version, release str if distro != nil { namespace = distro.ID } + if namespace == "rhel" { + namespace = "redhat" + } qualifiers := map[string]string{} diff --git a/syft/pkg/cataloger/redhat/package_test.go b/syft/pkg/cataloger/redhat/package_test.go index b5459717a..cc24d7d48 100644 --- a/syft/pkg/cataloger/redhat/package_test.go +++ b/syft/pkg/cataloger/redhat/package_test.go @@ -28,7 +28,7 @@ func Test_packageURL(t *testing.T) { Release: "r", Epoch: nil, }, - expected: "pkg:rpm/rhel/p@v-r?distro=rhel-8.4", + expected: "pkg:rpm/redhat/p@v-r?distro=rhel-8.4", }, { name: "with arch and epoch", @@ -67,7 +67,7 @@ func Test_packageURL(t *testing.T) { Release: "r", SourceRpm: "sourcerpm", }, - expected: "pkg:rpm/rhel/p@v-r?upstream=sourcerpm&distro=rhel-8.4", + expected: "pkg:rpm/redhat/p@v-r?upstream=sourcerpm&distro=rhel-8.4", }, }