mirror of
https://github.com/kubernetes/node-problem-detector.git
synced 2026-08-19 20:26:32 +00:00
Add rocky linux support to GetOSVersion
This commit is contained in:
@@ -56,6 +56,8 @@ func getOSVersion(osReleasePath string) (string, error) {
|
||||
return getDebianVersion(osReleaseMap), nil
|
||||
case "centos":
|
||||
return getDebianVersion(osReleaseMap), nil
|
||||
case "rocky":
|
||||
return getDebianVersion(osReleaseMap), nil
|
||||
case "rhel":
|
||||
return getDebianVersion(osReleaseMap), nil
|
||||
case "ol":
|
||||
|
||||
@@ -51,6 +51,12 @@ func TestGetOSVersionLinux(t *testing.T) {
|
||||
expectedOSVersion: "centos 7 (Core)",
|
||||
expectErr: false,
|
||||
},
|
||||
{
|
||||
name: "rocky",
|
||||
fakeOSReleasePath: "testdata/os-release-rocky",
|
||||
expectedOSVersion: "rocky 8.5 (Green Obsidian)",
|
||||
expectErr: false,
|
||||
},
|
||||
{
|
||||
name: "rhel",
|
||||
fakeOSReleasePath: "testdata/os-release-rhel",
|
||||
|
||||
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
NAME="Rocky Linux"
|
||||
VERSION="8.5 (Green Obsidian)"
|
||||
ID="rocky"
|
||||
ID_LIKE="rhel centos fedora"
|
||||
VERSION_ID="8.5"
|
||||
PLATFORM_ID="platform:el8"
|
||||
PRETTY_NAME="Rocky Linux 8.5 (Green Obsidian)"
|
||||
ANSI_COLOR="0;32"
|
||||
CPE_NAME="cpe:/o:rocky:rocky:8.5:GA"
|
||||
HOME_URL="https://rockylinux.org/"
|
||||
BUG_REPORT_URL="https://bugs.rockylinux.org/"
|
||||
ROCKY_SUPPORT_PRODUCT="Rocky Linux"
|
||||
ROCKY_SUPPORT_PRODUCT_VERSION="8"
|
||||
Reference in New Issue
Block a user