mirror of
https://github.com/kubernetes/node-problem-detector.git
synced 2026-08-19 12:16:26 +00:00
Merge pull request #424 from stpabhi/rhel-support
Add rhel support for osversion
This commit is contained in:
@@ -91,6 +91,8 @@ func GetOSVersion() (string, error) {
|
||||
return getDebianVersion(osReleaseMap), nil
|
||||
case "centos":
|
||||
return getDebianVersion(osReleaseMap), nil
|
||||
case "rhel":
|
||||
return getDebianVersion(osReleaseMap), nil
|
||||
default:
|
||||
return "", fmt.Errorf("Unsupported ID in /etc/os-release: %q", osReleaseMap["ID"])
|
||||
}
|
||||
|
||||
@@ -167,6 +167,12 @@ func TestGetOSVersion(t *testing.T) {
|
||||
expectedOSVersion: "centos 7 (Core)",
|
||||
expectErr: false,
|
||||
},
|
||||
{
|
||||
name: "rhel",
|
||||
fakeOSReleasePath: "testdata/os-release-rhel",
|
||||
expectedOSVersion: "rhel 7.7 (Maipo)",
|
||||
expectErr: false,
|
||||
},
|
||||
{
|
||||
name: "Unknown",
|
||||
fakeOSReleasePath: "testdata/os-release-unknown",
|
||||
|
||||
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
NAME="Red Hat Enterprise Linux Server"
|
||||
VERSION="7.7 (Maipo)"
|
||||
ID="rhel"
|
||||
ID_LIKE="fedora"
|
||||
VERSION_ID="7.7"
|
||||
PRETTY_NAME="Red Hat Enterprise Linux Server 7.7 (Maipo)"
|
||||
ANSI_COLOR="0;31"
|
||||
CPE_NAME="cpe:/o:redhat:enterprise_linux:7.7:GA:server"
|
||||
HOME_URL="https://www.redhat.com/"
|
||||
BUG_REPORT_URL="https://bugzilla.redhat.com/"
|
||||
|
||||
REDHAT_BUGZILLA_PRODUCT="Red Hat Enterprise Linux 7"
|
||||
REDHAT_BUGZILLA_PRODUCT_VERSION=7.7
|
||||
REDHAT_SUPPORT_PRODUCT="Red Hat Enterprise Linux"
|
||||
REDHAT_SUPPORT_PRODUCT_VERSION="7.7"
|
||||
Reference in New Issue
Block a user