Use redhat as namespace for redhat rpms (#2914)

The namespace value of `redhat` signifies this as an RPM package
produced and distributed by Red Hat.

Using "rhel" in the namespace is not correct.

Signed-off-by: Ralph Bean <rbean@redhat.com>
This commit is contained in:
Ralph Bean 2024-06-03 10:18:52 -04:00 committed by GitHub
parent 29d601d1f1
commit 8a7f08e2c8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 2 deletions

View file

@ -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{}

View file

@ -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",
},
}