Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions internal/kmmmodule/kmmmodule.go
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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,
Expand Down