Skip to content

Commit 6472b62

Browse files
Merge pull request #413 from ArangoGutierrez/fix_nvdriver_branch
Fix NVDriver templating
2 parents 5aee2c9 + 9f14fb2 commit 6472b62

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

pkg/provisioner/templates/nv-driver.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ import (
2424
"github.com/NVIDIA/holodeck/api/holodeck/v1alpha1"
2525
)
2626

27+
const defaultNVBranch = "575"
28+
2729
// From https://docs.nvidia.com/datacenter/tesla/tesla-installation-notes/index.html#ubuntu-lts
2830
const NvDriverTemplate = `
2931
# Install Dependencies
@@ -61,10 +63,14 @@ type NvDriver v1alpha1.NVIDIADriver
6163
func NewNvDriver(env v1alpha1.Environment) *NvDriver {
6264
var nvDriver NvDriver
6365

66+
// Propagate user-supplied settings
6467
nvDriver.Install = env.Spec.NVIDIADriver.Install
68+
nvDriver.Branch = env.Spec.NVIDIADriver.Branch
69+
nvDriver.Version = env.Spec.NVIDIADriver.Version
6570

66-
if env.Spec.NVIDIADriver.Branch == "" {
67-
nvDriver.Branch = "575"
71+
// Apply default branch only when neither a specific version nor a branch was provided
72+
if nvDriver.Version == "" && nvDriver.Branch == "" {
73+
nvDriver.Branch = defaultNVBranch
6874
}
6975

7076
return &nvDriver

0 commit comments

Comments
 (0)