syft/syft/distro/type.go
Swathi Gangisetty e732f419f8
Add new distro and mapping to support Rocky Linux distro identification (#624)
Signed-off-by: Swathi Gangisetty <swathi@anchore.com>
2021-11-12 13:10:21 -08:00

71 lines
1.7 KiB
Go

package distro
// Type represents the different Linux distribution options
type Type string
const (
// represents the set of valid/supported Linux Distributions
UnknownDistroType Type = "UnknownDistroType"
Debian Type = "debian"
Ubuntu Type = "ubuntu"
RedHat Type = "redhat"
CentOS Type = "centos"
Fedora Type = "fedora"
Alpine Type = "alpine"
Busybox Type = "busybox"
AmazonLinux Type = "amazonlinux"
OracleLinux Type = "oraclelinux"
ArchLinux Type = "archlinux"
OpenSuseLeap Type = "opensuseleap"
SLES Type = "sles"
Photon Type = "photon"
Windows Type = "windows"
Mariner Type = "mariner"
RockyLinux Type = "rockylinux"
)
// All contains all Linux distribution options
var All = []Type{
Debian,
Ubuntu,
RedHat,
CentOS,
Fedora,
Alpine,
Busybox,
AmazonLinux,
OracleLinux,
ArchLinux,
OpenSuseLeap,
SLES,
Photon,
Windows,
Mariner,
RockyLinux,
}
// IDMapping connects a distro ID like "ubuntu" to a Distro type
var IDMapping = map[string]Type{
"debian": Debian,
"ubuntu": Ubuntu,
"rhel": RedHat,
"centos": CentOS,
"fedora": Fedora,
"alpine": Alpine,
"busybox": Busybox,
"amzn": AmazonLinux,
"ol": OracleLinux,
"arch": ArchLinux,
"opensuse-leap": OpenSuseLeap,
"sles": SLES,
"photon": Photon,
"windows": Windows,
"mariner": Mariner,
"rocky": RockyLinux,
}
// String returns the string representation of the given Linux distribution.
func (t Type) String() string {
return string(t)
}