MCPcopy Create free account
hub / github.com/NVIDIA/gpu-operator / getDriverSpec

Function getDriverSpec

internal/state/driver.go:572–607  ·  view source on GitHub ↗
(cr *nvidiav1alpha1.NVIDIADriver, nodePool nodePool)

Source from the content-addressed store, hash-verified

570}
571
572func getDriverSpec(cr *nvidiav1alpha1.NVIDIADriver, nodePool nodePool) (*driverSpec, error) {
573 if cr == nil {
574 return nil, fmt.Errorf("no NVIDIADriver CR provided")
575 }
576
577 nvidiaDriverName := getDriverName(cr, nodePool.osTag)
578 nvidiaDriverAppName := getDriverAppName(cr, nodePool)
579
580 spec := cr.Spec.DeepCopy()
581 imagePath, err := getDriverImagePath(spec, nodePool)
582 if err != nil {
583 return nil, fmt.Errorf("failed to get driver image path: %v", err)
584 }
585
586 spec.NodeSelector = nodePool.nodeSelector
587
588 managerImagePath, err := image.ImagePath(spec.Manager.Repository, spec.Manager.Image, spec.Manager.Version, "DRIVER_MANAGER_IMAGE")
589 if err != nil {
590 return nil, fmt.Errorf("failed to construct image path for driver manager: %w", err)
591 }
592
593 if spec.StartupProbe == nil {
594 spec.StartupProbe = getDefaultStartupProbe(spec)
595 }
596
597 spec.Labels = sanitizeDriverLabels(spec.Labels)
598
599 return &driverSpec{
600 Spec: spec,
601 AppName: nvidiaDriverAppName,
602 Name: nvidiaDriverName,
603 ImagePath: imagePath,
604 ManagerImagePath: managerImagePath,
605 OSVersion: nodePool.osTag,
606 }, nil
607}
608
609func getGDSSpec(spec *nvidiav1alpha1.NVIDIADriverSpec, pool nodePool) (*gdsDriverSpec, error) {
610 if spec == nil || !spec.IsGDSEnabled() {

Callers 2

getManifestObjectsMethod · 0.85

Calls 7

ImagePathFunction · 0.92
getDriverNameFunction · 0.85
getDriverAppNameFunction · 0.85
getDriverImagePathFunction · 0.85
getDefaultStartupProbeFunction · 0.85
sanitizeDriverLabelsFunction · 0.85
DeepCopyMethod · 0.45

Tested by 1