From 963fbd3ba0293101e5dc01fbaec7d8701a2c8665 Mon Sep 17 00:00:00 2001 From: Srinivas Chavan <36725125+srinivaschavan@users.noreply.github.com> Date: Tue, 27 Aug 2024 23:51:30 +0530 Subject: [PATCH] Allowing regex to allow rocky linux 9.3 onboarding (#386) --- pkg/platform/centos/centos.go | 4 ++-- pkg/pmk/checkNode.go | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pkg/platform/centos/centos.go b/pkg/platform/centos/centos.go index 9cf82a9..9a6009d 100644 --- a/pkg/platform/centos/centos.go +++ b/pkg/platform/centos/centos.go @@ -136,7 +136,7 @@ func (c *CentOS) checkOSPackages() (bool, error) { zap.S().Debug("Checking OS Packages") rhel8, _ = regexp.MatchString(`.*8\.[5-9]\.*`, string(version)) - rocky9, _ = regexp.MatchString(`.*9\.[1-2,4]\.*`, string(version)) + rocky9, _ = regexp.MatchString(`.*9\.[1-4]\.*`, string(version)) if platform.SkipOSChecks { rhel8, _ = regexp.MatchString(`8\.\d{1,2}`, string(version)) @@ -379,7 +379,7 @@ func (c *CentOS) Version() (string, error) { return "redhat", nil } } - if match, _ := regexp.MatchString(`.*7\.[3-9]\.*|.*8\.[5-9]\.*|.*9\.[1-2,4]\.*`, string(version)); match { + if match, _ := regexp.MatchString(`.*7\.[3-9]\.*|.*8\.[5-9]\.*|.*9\.[1-4]\.*`, string(version)); match { return "redhat", nil } return "", fmt.Errorf("Unable to determine OS type: %s", string(version)) diff --git a/pkg/pmk/checkNode.go b/pkg/pmk/checkNode.go index 11e00c9..4c17cfd 100644 --- a/pkg/pmk/checkNode.go +++ b/pkg/pmk/checkNode.go @@ -65,7 +65,7 @@ func CheckNode(ctx objects.Config, allClients client.Client, auth keystone.Keyst case "redhat": platform = centos.NewCentOS(allClients.Executor) default: - return RequiredFail, fmt.Errorf("This OS is not supported. Supported operating systems are: Ubuntu (18.04, 20.04, 22.04), CentOS 7.[3-9], RHEL 7.[3-9] & RHEL 8.[5-9] & Rocky 9.[1-2,4]") + return RequiredFail, fmt.Errorf("This OS is not supported. Supported operating systems are: Ubuntu (18.04, 20.04, 22.04), CentOS 7.[3-9], RHEL 7.[3-9] & RHEL 8.[5-9] & Rocky 9.[1-4]") } if err = allClients.Segment.SendEvent("Starting CheckNode", auth, checkPass, ""); err != nil {