diff --git a/syft/distro/identify_test.go b/syft/distro/identify_test.go index 4f01f1578..f4b06efe1 100644 --- a/syft/distro/identify_test.go +++ b/syft/distro/identify_test.go @@ -75,6 +75,11 @@ func TestIdentifyDistro(t *testing.T) { Type: OpenSuseLeap, Version: "15.2.0", }, + { + fixture: "test-fixtures/os/sles", + Type: SLES, + Version: "15.2.0", + }, { fixture: "test-fixtures/os/photon", Type: Photon, diff --git a/syft/distro/test-fixtures/os/sles/etc/os-release b/syft/distro/test-fixtures/os/sles/etc/os-release new file mode 100644 index 000000000..9068e540c --- /dev/null +++ b/syft/distro/test-fixtures/os/sles/etc/os-release @@ -0,0 +1,9 @@ +NAME="SLES" +VERSION="15-SP2" +VERSION_ID="15.2" +PRETTY_NAME="SUSE Linux Enterprise Server 15 SP2" +ID="sles" +ID_LIKE="suse" +ANSI_COLOR="0;32" +CPE_NAME="cpe:/o:suse:sles:15:sp2" +DOCUMENTATION_URL="https://documentation.suse.com/" \ No newline at end of file diff --git a/syft/distro/type.go b/syft/distro/type.go index 607995ede..d29f22d15 100644 --- a/syft/distro/type.go +++ b/syft/distro/type.go @@ -17,6 +17,7 @@ const ( OracleLinux Type = "oraclelinux" ArchLinux Type = "archlinux" OpenSuseLeap Type = "opensuseleap" + SLES Type = "sles" Photon Type = "photon" Windows Type = "windows" ) @@ -34,6 +35,7 @@ var All = []Type{ OracleLinux, ArchLinux, OpenSuseLeap, + SLES, Photon, Windows, } @@ -51,6 +53,7 @@ var IDMapping = map[string]Type{ "ol": OracleLinux, "arch": ArchLinux, "opensuse-leap": OpenSuseLeap, + "sles": SLES, "photon": Photon, "windows": Windows, }