Add new distro and mapping to support Rocky Linux distro identification (#624)

Signed-off-by: Swathi Gangisetty <swathi@anchore.com>
This commit is contained in:
Swathi Gangisetty 2021-11-12 13:10:21 -08:00 committed by GitHub
parent 25835ef589
commit e732f419f8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 0 deletions

View File

@ -123,6 +123,11 @@ func TestIdentifyDistro(t *testing.T) {
Type: Mariner,
Version: "1.0.0",
},
{
fixture: "test-fixtures/os/rockylinux",
Type: RockyLinux,
Version: "8.4.0",
},
}
observedDistros := internal.NewStringSet()

View File

@ -0,0 +1,13 @@
NAME="Rocky Linux"
VERSION="8.4 (Green Obsidian)"
ID="rocky"
ID_LIKE="rhel fedora"
VERSION_ID="8.4"
PLATFORM_ID="platform:el8"
PRETTY_NAME="Rocky Linux 8.4 (Green Obsidian)"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:rocky:rocky:8.4:GA"
HOME_URL="https://rockylinux.org/"
BUG_REPORT_URL="https://bugs.rockylinux.org/"
ROCKY_SUPPORT_PRODUCT="Rocky Linux"
ROCKY_SUPPORT_PRODUCT_VERSION="8"

View File

@ -21,6 +21,7 @@ const (
Photon Type = "photon"
Windows Type = "windows"
Mariner Type = "mariner"
RockyLinux Type = "rockylinux"
)
// All contains all Linux distribution options
@ -40,6 +41,7 @@ var All = []Type{
Photon,
Windows,
Mariner,
RockyLinux,
}
// IDMapping connects a distro ID like "ubuntu" to a Distro type
@ -59,6 +61,7 @@ var IDMapping = map[string]Type{
"photon": Photon,
"windows": Windows,
"mariner": Mariner,
"rocky": RockyLinux,
}
// String returns the string representation of the given Linux distribution.