diff --git a/syft/distro/identify_test.go b/syft/distro/identify_test.go index f1b7e048f..6343f561e 100644 --- a/syft/distro/identify_test.go +++ b/syft/distro/identify_test.go @@ -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() diff --git a/syft/distro/test-fixtures/os/rockylinux/etc/os-release b/syft/distro/test-fixtures/os/rockylinux/etc/os-release new file mode 100644 index 000000000..2b0f97169 --- /dev/null +++ b/syft/distro/test-fixtures/os/rockylinux/etc/os-release @@ -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" \ No newline at end of file diff --git a/syft/distro/type.go b/syft/distro/type.go index 98cb77dd6..aa1fd8bb0 100644 --- a/syft/distro/type.go +++ b/syft/distro/type.go @@ -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.