Skip to content

Commit 3193edc

Browse files
committed
[Feature] Add minimal AlmaLinux support (#53)
Signed-off-by: Raulian-Ionut Chiorescu <raulian-ionut.chiorescu@cern.ch>
1 parent ae48e0c commit 3193edc

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

internal/kmmmodule/kmmmodule.go

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,9 @@ func resolveDockerfile(cmName string, devConfig *amdv1alpha1.DeviceConfig) (stri
280280
dockerfileTemplate = dockerfileTemplateCoreOSFromSrcImage
281281
}
282282
}
283+
case "almalinux":
284+
// change when Alma would be fully supported
285+
dockerfileTemplate= dockerfileTemplateCoreOSFromSrcImage
283286
// FIX ME
284287
// add the RHEL back when it is fully supported
285288
/*case "rhel":
@@ -779,6 +782,7 @@ var cmNameMappers = map[string]func(fullImageStr string) string{
779782
"rhel": rhelCMNameMapper,
780783
"red hat": rhelCMNameMapper,
781784
"redhat": rhelCMNameMapper,
785+
"almalinux": almaCMNameMapper,
782786
}
783787

784788
func rhelCMNameMapper(osImageStr string) string {
@@ -812,6 +816,14 @@ func ubuntuCMNameMapper(osImageStr string) string {
812816
return fmt.Sprintf("%s-%s", os, trimmedVersion)
813817
}
814818

819+
func almaCMNameMapper(osImageStr string) string {
820+
re := regexp.MustCompile(`(\d+\.\d+)`)
821+
matches := re.FindStringSubmatch(osImageStr)
822+
if len(matches) > 1 {
823+
return fmt.Sprintf("%s-%s", "almalinux", matches[1])
824+
}
825+
return "almalinux-" + osImageStr
826+
}
815827
func GetK8SNodes(ctx context.Context, cli client.Client, labelSelector labels.Selector) (*v1.NodeList, error) {
816828
options := &client.ListOptions{
817829
LabelSelector: labelSelector,

0 commit comments

Comments
 (0)