mirror of
https://github.com/anchore/syft.git
synced 2025-11-17 08:23:15 +01:00
Add new distro and mapping to support Rocky Linux distro identification
Signed-off-by: Swathi Gangisetty <swathi@anchore.com>
This commit is contained in:
parent
a2882ee810
commit
e4785c320b
@ -123,6 +123,11 @@ func TestIdentifyDistro(t *testing.T) {
|
|||||||
Type: Mariner,
|
Type: Mariner,
|
||||||
Version: "1.0.0",
|
Version: "1.0.0",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
fixture: "test-fixtures/os/rockylinux",
|
||||||
|
Type: RockyLinux,
|
||||||
|
Version: "8.4.0",
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
observedDistros := internal.NewStringSet()
|
observedDistros := internal.NewStringSet()
|
||||||
|
|||||||
13
syft/distro/test-fixtures/os/rockylinux/etc/os-release
Normal file
13
syft/distro/test-fixtures/os/rockylinux/etc/os-release
Normal file
@ -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"
|
||||||
@ -21,6 +21,7 @@ const (
|
|||||||
Photon Type = "photon"
|
Photon Type = "photon"
|
||||||
Windows Type = "windows"
|
Windows Type = "windows"
|
||||||
Mariner Type = "mariner"
|
Mariner Type = "mariner"
|
||||||
|
RockyLinux Type = "rockylinux"
|
||||||
)
|
)
|
||||||
|
|
||||||
// All contains all Linux distribution options
|
// All contains all Linux distribution options
|
||||||
@ -40,6 +41,7 @@ var All = []Type{
|
|||||||
Photon,
|
Photon,
|
||||||
Windows,
|
Windows,
|
||||||
Mariner,
|
Mariner,
|
||||||
|
RockyLinux,
|
||||||
}
|
}
|
||||||
|
|
||||||
// IDMapping connects a distro ID like "ubuntu" to a Distro type
|
// IDMapping connects a distro ID like "ubuntu" to a Distro type
|
||||||
@ -59,6 +61,7 @@ var IDMapping = map[string]Type{
|
|||||||
"photon": Photon,
|
"photon": Photon,
|
||||||
"windows": Windows,
|
"windows": Windows,
|
||||||
"mariner": Mariner,
|
"mariner": Mariner,
|
||||||
|
"rocky": RockyLinux,
|
||||||
}
|
}
|
||||||
|
|
||||||
// String returns the string representation of the given Linux distribution.
|
// String returns the string representation of the given Linux distribution.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user