Adding AlmaLinux OS Support (#652)

* Adding AlmaLinux Support

Signed-off-by: Bala Raman <srbala@gmail.com>

* Adding AlmaLinux Support

Signed-off-by: Bala Raman <srbala@gmail.com>
This commit is contained in:
Bala Raman 2021-12-07 15:59:31 -05:00 committed by GitHub
parent 7957294b26
commit 7a359dc16b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 24 additions and 2 deletions

View File

@ -6,10 +6,9 @@ import (
"os" "os"
"testing" "testing"
hashiVer "github.com/hashicorp/go-version"
"github.com/anchore/syft/internal" "github.com/anchore/syft/internal"
"github.com/anchore/syft/syft/source" "github.com/anchore/syft/syft/source"
hashiVer "github.com/hashicorp/go-version"
"github.com/stretchr/testify/assert" "github.com/stretchr/testify/assert"
) )
@ -128,6 +127,11 @@ func TestIdentifyDistro(t *testing.T) {
Type: RockyLinux, Type: RockyLinux,
Version: "8.4.0", Version: "8.4.0",
}, },
{
fixture: "test-fixtures/os/almalinux",
Type: AlmaLinux,
Version: "8.4.0",
},
} }
observedDistros := internal.NewStringSet() observedDistros := internal.NewStringSet()

View File

@ -0,0 +1,15 @@
NAME="AlmaLinux"
VERSION="8.4 (Electric Cheetah)"
ID="almalinux"
ID_LIKE="rhel centos fedora"
VERSION_ID="8.4"
PLATFORM_ID="platform:el8"
PRETTY_NAME="AlmaLinux 8.4 (Electric Cheetah)"
ANSI_COLOR="0;34"
CPE_NAME="cpe:/o:almalinux:almalinux:8.4:GA"
HOME_URL="https://almalinux.org/"
DOCUMENTATION_URL="https://wiki.almalinux.org/"
BUG_REPORT_URL="https://bugs.almalinux.org/"
ALMALINUX_MANTISBT_PROJECT="AlmaLinux-8"
ALMALINUX_MANTISBT_PROJECT_VERSION="8.4"

View File

@ -22,6 +22,7 @@ const (
Windows Type = "windows" Windows Type = "windows"
Mariner Type = "mariner" Mariner Type = "mariner"
RockyLinux Type = "rockylinux" RockyLinux Type = "rockylinux"
AlmaLinux Type = "almalinux"
) )
// All contains all Linux distribution options // All contains all Linux distribution options
@ -42,6 +43,7 @@ var All = []Type{
Windows, Windows,
Mariner, Mariner,
RockyLinux, RockyLinux,
AlmaLinux,
} }
// IDMapping connects a distro ID like "ubuntu" to a Distro type // IDMapping connects a distro ID like "ubuntu" to a Distro type
@ -62,6 +64,7 @@ var IDMapping = map[string]Type{
"windows": Windows, "windows": Windows,
"mariner": Mariner, "mariner": Mariner,
"rocky": RockyLinux, "rocky": RockyLinux,
"almalinux": AlmaLinux,
} }
// String returns the string representation of the given Linux distribution. // String returns the string representation of the given Linux distribution.