From b82e56a9a812676781e771234fe3ed026840b119 Mon Sep 17 00:00:00 2001 From: Raulian-Ionut Chiorescu Date: Thu, 19 Feb 2026 10:45:34 +0100 Subject: [PATCH] [Feature] Add minimal AlmaLinux support (#53) Signed-off-by: Raulian-Ionut Chiorescu --- internal/kmmmodule/kmmmodule.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/internal/kmmmodule/kmmmodule.go b/internal/kmmmodule/kmmmodule.go index 802caeba..8f7f6552 100644 --- a/internal/kmmmodule/kmmmodule.go +++ b/internal/kmmmodule/kmmmodule.go @@ -280,6 +280,9 @@ func resolveDockerfile(cmName string, devConfig *amdv1alpha1.DeviceConfig) (stri dockerfileTemplate = dockerfileTemplateCoreOSFromSrcImage } } + case "almalinux": + // change when Alma would be fully supported + dockerfileTemplate= dockerfileTemplateCoreOSFromSrcImage // FIX ME // add the RHEL back when it is fully supported /*case "rhel": @@ -779,6 +782,7 @@ var cmNameMappers = map[string]func(fullImageStr string) string{ "rhel": rhelCMNameMapper, "red hat": rhelCMNameMapper, "redhat": rhelCMNameMapper, + "almalinux": almaCMNameMapper, } func rhelCMNameMapper(osImageStr string) string { @@ -812,6 +816,15 @@ func ubuntuCMNameMapper(osImageStr string) string { return fmt.Sprintf("%s-%s", os, trimmedVersion) } +func almaCMNameMapper(osImageStr string) string { + re := regexp.MustCompile(`(\d+\.\d+)`) + matches := re.FindStringSubmatch(osImageStr) + if len(matches) > 1 { + return fmt.Sprintf("%s-%s", "almalinux", matches[1]) + } + return "almalinux-" + osImageStr +} + func GetK8SNodes(ctx context.Context, cli client.Client, labelSelector labels.Selector) (*v1.NodeList, error) { options := &client.ListOptions{ LabelSelector: labelSelector,