From 28df39e31f253c8b738b24f4f9e3a3e110139f79 Mon Sep 17 00:00:00 2001 From: Tariq Ibrahim Date: Wed, 14 Jan 2026 14:08:55 -0800 Subject: [PATCH] add support for RockyLinux driver containers Signed-off-by: Tariq Ibrahim --- controllers/object_controls.go | 8 ++++++++ internal/state/driver_volumes.go | 2 ++ internal/state/nodepool.go | 5 +++++ 3 files changed, 15 insertions(+) diff --git a/controllers/object_controls.go b/controllers/object_controls.go index ab8aeb577..a46ec7c5e 100644 --- a/controllers/object_controls.go +++ b/controllers/object_controls.go @@ -207,6 +207,7 @@ var RepoConfigPathMap = map[string]string{ "ubuntu": "/etc/apt/sources.list.d", "rhcos": "/etc/yum.repos.d", "rhel": "/etc/yum.repos.d", + "rocky": "/etc/yum.repos.d", "sles": "/etc/zypp/repos.d", "sl-micro": "/etc/zypp/repos.d", } @@ -221,6 +222,7 @@ var CertConfigPathMap = map[string]string{ "ubuntu": "/usr/local/share/ca-certificates", "rhcos": "/etc/pki/ca-trust/extracted/pem", "rhel": "/etc/pki/ca-trust/extracted/pem", + "rocky": "/etc/pki/ca-trust/extracted/pem", "sles": "/etc/pki/trust/anchors", "sl-micro": "/etc/pki/trust/anchors", } @@ -704,6 +706,12 @@ func kernelFullVersion(n ClusterPolicyController) (string, string, string) { if !ok { return kFVersion, "", "" } + + if osName == "rocky" { + // If the OS is RockyLinux, we will omit the RockyLinux minor version when constructing the os image tag + osVersion = strings.Split(osVersion, ".")[0] + } + osTag := fmt.Sprintf("%s%s", osName, osVersion) return kFVersion, osTag, osVersion diff --git a/internal/state/driver_volumes.go b/internal/state/driver_volumes.go index fd6669947..c9e13b998 100644 --- a/internal/state/driver_volumes.go +++ b/internal/state/driver_volumes.go @@ -37,6 +37,7 @@ var RepoConfigPathMap = map[string]string{ "ubuntu": "/etc/apt/sources.list.d", "rhcos": "/etc/yum.repos.d", "rhel": "/etc/yum.repos.d", + "rocky": "/etc/yum.repos.d", "sles": "/etc/zypp/repos.d", "sl-micro": "/etc/zypp/repos.d", } @@ -51,6 +52,7 @@ var CertConfigPathMap = map[string]string{ "ubuntu": "/usr/local/share/ca-certificates", "rhcos": "/etc/pki/ca-trust/extracted/pem", "rhel": "/etc/pki/ca-trust/extracted/pem", + "rocky": "/etc/pki/ca-trust/extracted/pem", "sles": "/etc/pki/trust/anchors", "sl-micro": "/etc/pki/trust/anchors", } diff --git a/internal/state/nodepool.go b/internal/state/nodepool.go index cd1d68b72..3f27706e0 100644 --- a/internal/state/nodepool.go +++ b/internal/state/nodepool.go @@ -20,6 +20,7 @@ import ( "context" "fmt" "maps" + "strings" corev1 "k8s.io/api/core/v1" "sigs.k8s.io/controller-runtime/pkg/client" @@ -132,5 +133,9 @@ func getNodePools(ctx context.Context, k8sClient client.Client, selector map[str } func (n nodePool) getOS() string { + if n.osRelease == "rocky" { + // If the OS is RockyLinux, we will omit the RockyLinux minor version when constructing the os image tag + n.osVersion = strings.Split(n.osRelease, ".")[0] + } return fmt.Sprintf("%s%s", n.osRelease, n.osVersion) }