From 1242965b9edbd6f97a2cc413d0f99c0909512c18 Mon Sep 17 00:00:00 2001 From: Mark Waite Date: Fri, 17 Nov 2023 19:00:26 -0700 Subject: [PATCH] Drop RHEL 7 and derivatives Scientific Linux is completely gone --- README.md | 4 ++-- .../hudson/plugins/platformlabeler/PlatformDetailsTask.java | 2 -- .../platformlabeler/PlatformDetailsTaskLsbReleaseTest.java | 3 --- .../platformlabeler/PlatformDetailsTaskReleaseTest.java | 3 --- .../plugins/platformlabeler/PlatformDetailsTaskTest.java | 4 ++-- 5 files changed, 4 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 82dd0ebe9..887a877d5 100644 --- a/README.md +++ b/README.md @@ -67,12 +67,12 @@ On Windows computers, the plugin assigns a label based on the Windows feature up Feature update labels use a two digit year and a two digit month representation. Common values for Windows feature update are `1809`, `1903`, `2009`, and `2109`. -On Linux computers, the plugin uses the output of the [`lsb_release`](https://linux.die.net/man/1/lsb_release) command. +On Linux computers, the plugin uses the output of the [`lsb_release`](https://linux.die.net/man/1/lsb_release) command if the command is available. If `lsb_release` is not installed, labels on Linux agents will be guessed based on values in `/etc/os-release`. Red Hat Linux 9 and its derivatives intentionally do not delivery `lsb_release`. -Red Hat Linux and Scientific Linux agents have another fallback based on `/etc/redhat-release`. +Red Hat Linux agents have another fallback based on `/etc/redhat-release`. Agents with an older version of SuSE Linux will fallback to `/etc/SuSE-release`. Older versions of this plugin might return "sles" or "SUSE LINUX" as OS name. This has been unified to "SUSE" as this is the lsb_release ID since 'SLES 12 SP2'. diff --git a/src/main/java/org/jvnet/hudson/plugins/platformlabeler/PlatformDetailsTask.java b/src/main/java/org/jvnet/hudson/plugins/platformlabeler/PlatformDetailsTask.java index 2d9b3a895..bd252cd6b 100644 --- a/src/main/java/org/jvnet/hudson/plugins/platformlabeler/PlatformDetailsTask.java +++ b/src/main/java/org/jvnet/hudson/plugins/platformlabeler/PlatformDetailsTask.java @@ -347,8 +347,6 @@ protected PlatformDetails computeLabels( PREFERRED_LINUX_OS_NAMES.put("rhel", "RedHatEnterprise"); PREFERRED_LINUX_OS_NAMES.put("sles", "SUSE"); PREFERRED_LINUX_OS_NAMES.put("SUSE Linux Enterprise Server", "SUSE"); - PREFERRED_LINUX_OS_NAMES.put("Scientific Linux", "Scientific"); - PREFERRED_LINUX_OS_NAMES.put("scientific", "Scientific"); PREFERRED_LINUX_OS_NAMES.put("ubuntu", "Ubuntu"); } diff --git a/src/test/java/org/jvnet/hudson/plugins/platformlabeler/PlatformDetailsTaskLsbReleaseTest.java b/src/test/java/org/jvnet/hudson/plugins/platformlabeler/PlatformDetailsTaskLsbReleaseTest.java index e8fe08fa1..cc67a5f2e 100644 --- a/src/test/java/org/jvnet/hudson/plugins/platformlabeler/PlatformDetailsTaskLsbReleaseTest.java +++ b/src/test/java/org/jvnet/hudson/plugins/platformlabeler/PlatformDetailsTaskLsbReleaseTest.java @@ -112,9 +112,6 @@ private static String computeExpectedName(String filename) { if (filename.contains("ubuntu")) { return "Ubuntu"; } - if (filename.contains("scientific")) { - return "Scientific"; - } if (filename.contains("sles")) { return "SUSE"; } diff --git a/src/test/java/org/jvnet/hudson/plugins/platformlabeler/PlatformDetailsTaskReleaseTest.java b/src/test/java/org/jvnet/hudson/plugins/platformlabeler/PlatformDetailsTaskReleaseTest.java index d6ab59595..fc5dae9b1 100644 --- a/src/test/java/org/jvnet/hudson/plugins/platformlabeler/PlatformDetailsTaskReleaseTest.java +++ b/src/test/java/org/jvnet/hudson/plugins/platformlabeler/PlatformDetailsTaskReleaseTest.java @@ -136,9 +136,6 @@ private static String computeExpectedName(String filename) { if (filename.contains("ubuntu")) { return "Ubuntu"; } - if (filename.contains("scientific")) { - return "Scientific"; - } if (filename.contains("sles")) { return "SUSE"; } diff --git a/src/test/java/org/jvnet/hudson/plugins/platformlabeler/PlatformDetailsTaskTest.java b/src/test/java/org/jvnet/hudson/plugins/platformlabeler/PlatformDetailsTaskTest.java index 150ed1336..22401a006 100644 --- a/src/test/java/org/jvnet/hudson/plugins/platformlabeler/PlatformDetailsTaskTest.java +++ b/src/test/java/org/jvnet/hudson/plugins/platformlabeler/PlatformDetailsTaskTest.java @@ -272,8 +272,8 @@ void compareOSVersion() throws Exception { String version = platformDetailsTask.getReleaseIdentifier("VERSION_ID"); /* Check that the version string returned by getReleaseIdentifier * is at least at the beginning of one of the detail values. Allow - * Debian 10 and CentOS 7 to report their base version - * in the /etc/os-release file without reporting their incremental + * Debian 10 to report its base version + * in the /etc/os-release file without reporting the incremental * version. * * If Debian unstable is in a freeze, then /etc/os-release