Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions controllers/object_controls.go
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ var RepoConfigPathMap = map[string]string{
"rhcos": "/etc/yum.repos.d",
"rhel": "/etc/yum.repos.d",
"rocky": "/etc/yum.repos.d",
"ol": "/etc/yum.repos.d",
"sles": "/etc/zypp/repos.d",
"sl-micro": "/etc/zypp/repos.d",
}
Expand All @@ -231,6 +232,7 @@ var CertConfigPathMap = map[string]string{
"rhcos": "/etc/pki/ca-trust/extracted/pem",
"rhel": "/etc/pki/ca-trust/extracted/pem",
"rocky": "/etc/pki/ca-trust/extracted/pem",
"ol": "/etc/pki/ca-trust/extracted/pem",
"sles": "/etc/pki/trust/anchors",
"sl-micro": "/etc/pki/trust/anchors",
}
Expand Down
4 changes: 2 additions & 2 deletions controllers/state_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -610,9 +610,9 @@ func (n *ClusterPolicyController) getGPUNodeOSInfo() (string, string, error) {
if !ok {
return "", "", fmt.Errorf("unable to retrieve OS version from label %s", nfdOSVersionIDLabelKey)
}
// If the OS is RockyLinux or RHEL, we will omit the minor version when constructing the os image tag
// If the OS is RockyLinux, Oracle Linux or RHEL, we will omit the minor version when constructing the os image tag
switch osName {
case "rocky", "rhel":
case "ol", "rocky", "rhel":
osVersion = strings.Split(osVersion, ".")[0]
}
osTag := fmt.Sprintf("%s%s", osName, osVersion)
Expand Down
6 changes: 6 additions & 0 deletions controllers/state_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,12 @@ func TestGetGPUNodeOSInfo(t *testing.T) {
osVersion: "9.5",
expected: "rocky9",
},
{
name: "ol omits minor version",
osName: "ol",
osVersion: "9.5",
expected: "ol9",
},
{
name: "ubuntu preserves full version",
osName: "ubuntu",
Expand Down
8 changes: 8 additions & 0 deletions internal/state/driver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -795,6 +795,14 @@ func TestGetDriverAppName(t *testing.T) {
actual = getDriverAppName(cr, pool)
assert.Equal(t, "nvidia-gpu-driver-rocky9-59b779bcc5", actual)

// Oracle Linux
pool.osRelease = "ol"
pool.osVersion = "9.7"
pool.osTag, err = getOSTag(pool.osRelease, pool.osVersion)
assert.NoError(t, err)
actual = getDriverAppName(cr, pool)
assert.Equal(t, "nvidia-gpu-driver-ol9-59b779bcc5", actual)

// RHEL10
pool.osRelease = "rhel"
pool.osVersion = "10.1"
Expand Down
2 changes: 2 additions & 0 deletions internal/state/driver_volumes.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ var RepoConfigPathMap = map[string]string{
"rhcos": "/etc/yum.repos.d",
"rhel": "/etc/yum.repos.d",
"rocky": "/etc/yum.repos.d",
"ol": "/etc/yum.repos.d",
"sles": "/etc/zypp/repos.d",
"sl-micro": "/etc/zypp/repos.d",
}
Expand All @@ -53,6 +54,7 @@ var CertConfigPathMap = map[string]string{
"rhcos": "/etc/pki/ca-trust/extracted/pem",
"rhel": "/etc/pki/ca-trust/extracted/pem",
"rocky": "/etc/pki/ca-trust/extracted/pem",
"ol": "/etc/pki/ca-trust/extracted/pem",
"sles": "/etc/pki/trust/anchors",
"sl-micro": "/etc/pki/trust/anchors",
}
Expand Down
4 changes: 2 additions & 2 deletions internal/state/nodepool.go
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,9 @@ func getNodePools(ctx context.Context, k8sClient client.Client, cr *nvidiav1alph

func getOSTag(osRelease, osVersion string) (string, error) {
var osTagSuffix string
// If the OS is RockyLinux or RHEL, we will omit the minor version when constructing the os image tag
// If the OS is RockyLinux, Oracle Linux or RHEL, we will omit the minor version when constructing the os image tag
switch osRelease {
case "rocky", "rhel":
case "ol", "rocky", "rhel":
osTagSuffix = strings.Split(osVersion, ".")[0]
default:
osTagSuffix = osVersion
Expand Down
7 changes: 7 additions & 0 deletions internal/state/nodepool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,13 @@ func TestGetOSTag(t *testing.T) {
expected: "rocky9",
expectError: false,
},
{
description: "oracle linux",
osRelease: "ol",
osVersion: "9.4",
expected: "ol9",
expectError: false,
},
{
description: "RHEL 10",
osRelease: "rhel",
Expand Down
Loading