Add new distro and mapping to support Rocky Linux distro identification

Signed-off-by: Swathi Gangisetty <swathi@anchore.com>
This commit is contained in:
Swathi Gangisetty 2021-11-10 22:12:37 -08:00
parent a2882ee810
commit e4785c320b
3 changed files with 21 additions and 0 deletions

View File

@ -123,6 +123,11 @@ func TestIdentifyDistro(t *testing.T) {
Type: Mariner, Type: Mariner,
Version: "1.0.0", Version: "1.0.0",
}, },
{
fixture: "test-fixtures/os/rockylinux",
Type: RockyLinux,
Version: "8.4.0",
},
} }
observedDistros := internal.NewStringSet() 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" Photon Type = "photon"
Windows Type = "windows" Windows Type = "windows"
Mariner Type = "mariner" Mariner Type = "mariner"
RockyLinux Type = "rockylinux"
) )
// All contains all Linux distribution options // All contains all Linux distribution options
@ -40,6 +41,7 @@ var All = []Type{
Photon, Photon,
Windows, Windows,
Mariner, Mariner,
RockyLinux,
} }
// IDMapping connects a distro ID like "ubuntu" to a Distro type // IDMapping connects a distro ID like "ubuntu" to a Distro type
@ -59,6 +61,7 @@ var IDMapping = map[string]Type{
"photon": Photon, "photon": Photon,
"windows": Windows, "windows": Windows,
"mariner": Mariner, "mariner": Mariner,
"rocky": RockyLinux,
} }
// String returns the string representation of the given Linux distribution. // String returns the string representation of the given Linux distribution.