Merge pull request #341 from octarinesec/add_photon_to_list_of_distros

Added Photon OS to the list of distros
This commit is contained in:
Alex Goodman 2021-03-16 07:29:18 -04:00 committed by GitHub
commit a83d79f330
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 0 deletions

View file

@ -75,6 +75,11 @@ func TestIdentifyDistro(t *testing.T) {
Type: OpenSuseLeap,
Version: "15.2.0",
},
{
fixture: "test-fixtures/os/photon",
Type: Photon,
Version: "2.0.0",
},
{
fixture: "test-fixtures/os/arch",
Type: ArchLinux,

View file

@ -0,0 +1,8 @@
NAME="VMware Photon OS"
VERSION="2.0"
ID=photon
VERSION_ID=2.0
PRETTY_NAME="VMware Photon OS/Linux"
ANSI_COLOR="1;34"
HOME_URL="https://vmware.github.io/photon/"
BUG_REPORT_URL="https://github.com/vmware/photon/issues"

View file

@ -17,6 +17,7 @@ const (
OracleLinux Type = "oraclelinux"
ArchLinux Type = "archlinux"
OpenSuseLeap Type = "opensuseleap"
Photon Type = "photon"
)
// All contains all Linux distribution options
@ -32,6 +33,7 @@ var All = []Type{
OracleLinux,
ArchLinux,
OpenSuseLeap,
Photon,
}
// IDMapping connects a distro ID like "ubuntu" to a Distro type
@ -47,6 +49,7 @@ var IDMapping = map[string]Type{
"ol": OracleLinux,
"arch": ArchLinux,
"opensuse-leap": OpenSuseLeap,
"photon": Photon,
}
// String returns the string representation of the given Linux distribution.