• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

NVIDIA / gpu-operator / 29513807383

16 Jul 2026 03:58PM UTC coverage: 32.688% (+0.9%) from 31.812%
29513807383

Pull #2571

github

karthikvetrivel
Add golden render tests for GPUCluster operand manifests

Signed-off-by: Karthik Vetrivel <kvetrivel@nvidia.com>
Pull Request #2571: Add GPUCluster CRD and controller for DRA-based stack

513 of 1343 new or added lines in 31 files covered. (38.2%)

5 existing lines in 4 files now uncovered.

4663 of 14265 relevant lines covered (32.69%)

0.37 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/cmd/nvidia-validator/driver.go
1
/*
2
# Copyright 2024 NVIDIA CORPORATION
3
#
4
# Licensed under the Apache License, Version 2.0 (the "License");
5
# you may not use this file except in compliance with the License.
6
# You may obtain a copy of the License at
7
#
8
#     http://www.apache.org/licenses/LICENSE-2.0
9
#
10
# Unless required by applicable law or agreed to in writing, software
11
# distributed under the License is distributed on an "AS IS" BASIS,
12
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
# See the License for the specific language governing permissions and
14
# limitations under the License.
15
*/
16

17
package main
18

19
import (
20
        "github.com/NVIDIA/gpu-operator/internal/driverroot"
21
)
22

23
// driverInfo contains information about an NVIDIA driver installation.
24
//
25
// isHostDriver indicates whether the driver is installed directly on
26
// the host at the host's root filesystem.
27
//
28
// hostRoot represents the host's root filesystem (typically '/').
29
//
30
// driverRoot and devRoot represent the absolute paths of the driver install
31
// and NVIDIA device nodes on the host.
32
//
33
// driverRootCtrPath and devRootCtrPath represent the paths of the driver install
34
// and NVIDIA device nodes in the management containers that require them, like
35
// the Toolkit Container, the Device Plugin, and MIG Manager.
36
type driverInfo struct {
37
        isHostDriver      bool
38
        hostRoot          string
39
        driverRoot        string
40
        driverRootCtrPath string
41
        devRoot           string
42
        devRootCtrPath    string
43
}
44

45
func getDriverInfo(isHostDriver bool, hostRoot string, driverInstallDir string, driverInstallDirCtrPath string) driverInfo {
×
46
        if isHostDriver {
×
47
                return driverInfo{
×
48
                        isHostDriver:      true,
×
49
                        hostRoot:          hostRoot,
×
50
                        driverRoot:        hostRoot,
×
51
                        driverRootCtrPath: "/host",
×
52
                        devRoot:           hostRoot,
×
53
                        devRootCtrPath:    "/host",
×
54
                }
×
55
        }
×
56

57
        // For drivers not installed directly on the host, devRoot can either be
58
        // hostRoot or driverInstallDir
59
        var devRoot, devRootCtrPath string
×
NEW
60
        devRoot = driverroot.Root(driverInstallDirCtrPath).GetDevRoot()
×
61
        if devRoot == "/" {
×
62
                devRoot = hostRoot
×
63
                devRootCtrPath = "/host"
×
64
        } else {
×
65
                devRoot = driverInstallDir
×
66
                devRootCtrPath = "/driver-root"
×
67
        }
×
68

69
        return driverInfo{
×
70
                isHostDriver:      false,
×
71
                hostRoot:          hostRoot,
×
72
                driverRoot:        driverInstallDir,
×
73
                driverRootCtrPath: "/driver-root",
×
74
                devRoot:           devRoot,
×
75
                devRootCtrPath:    devRootCtrPath,
×
76
        }
×
77
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc