Skip to content

Commit 17a2377

Browse files
authored
Merge pull request #734 from NVIDIA/minor-cleanup
minor cleanup and improvements
2 parents 1ef3f40 + b90ee5d commit 17a2377

File tree

9 files changed

+20
-19
lines changed

9 files changed

+20
-19
lines changed

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
run:
2-
deadline: 10m
2+
timeout: 10m
33

44
linters:
55
enable:

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@
135135
## v1.14.0-rc.2
136136
* Fix bug causing incorrect nvidia-smi symlink to be created on WSL2 systems with multiple driver roots.
137137
* Remove dependency on coreutils when installing package on RPM-based systems.
138-
* Create ouput folders if required when running `nvidia-ctk runtime configure`
138+
* Create output folders if required when running `nvidia-ctk runtime configure`
139139
* Generate default config as post-install step.
140140
* Added support for detecting GSP firmware at custom paths when generating CDI specifications.
141141
* Added logic to skip the extraction of image requirements if `NVIDIA_DISABLE_REQUIRES` is set to `true`.

cmd/nvidia-ctk/runtime/configure/configure.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ type command struct {
5454
logger logger.Interface
5555
}
5656

57-
// NewCommand constructs an configure command with the specified logger
57+
// NewCommand constructs a configure command with the specified logger
5858
func NewCommand(logger logger.Interface) *cli.Command {
5959
c := command{
6060
logger: logger,
@@ -289,7 +289,7 @@ func (m command) configureConfigFile(c *cli.Context, config *config) error {
289289
return fmt.Errorf("failed to enable CDI in %s: %w", config.runtime, err)
290290
}
291291

292-
outputPath := config.getOuputConfigPath()
292+
outputPath := config.getOutputConfigPath()
293293
n, err := cfg.Save(outputPath)
294294
if err != nil {
295295
return fmt.Errorf("unable to flush config: %v", err)
@@ -346,8 +346,8 @@ func (c *config) getCommandConfigSource() toml.Loader {
346346
return toml.Empty
347347
}
348348

349-
// getOuputConfigPath returns the configured config path or "" if dry-run is enabled
350-
func (c *config) getOuputConfigPath() string {
349+
// getOutputConfigPath returns the configured config path or "" if dry-run is enabled
350+
func (c *config) getOutputConfigPath() string {
351351
if c.dryRun {
352352
return ""
353353
}

internal/platform-support/tegra/csv.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ func (o tegraOptions) newDiscovererFromCSVFiles() (discover.Discover, error) {
6262
o.nvidiaCDIHookPath,
6363
)
6464

65-
// We process the expliclitlty requested symlinks.
65+
// We process the explicitly requested symlinks.
6666
symlinkTargets := o.ignorePatterns.Apply(targetsByType[csv.MountSpecSym]...)
6767
o.logger.Debugf("Filtered symlink targets: %v", symlinkTargets)
6868
symlinks := discover.NewMounts(

pkg/config/engine/containerd/config_v1.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,14 +141,14 @@ func (c *ConfigV1) RemoveRuntime(name string) error {
141141
return nil
142142
}
143143

144-
// SetOption sets the specified containerd option.
144+
// Set sets the specified containerd option.
145145
func (c *ConfigV1) Set(key string, value interface{}) {
146146
config := *c.Tree
147147
config.SetPath([]string{"plugins", "cri", "containerd", key}, value)
148148
*c.Tree = config
149149
}
150150

151-
// Save wrotes the config to a file
151+
// Save writes the config to a file
152152
func (c ConfigV1) Save(path string) (int64, error) {
153153
return (Config)(c).Save(path)
154154
}

pkg/config/engine/containerd/containerd.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ type containerdCfgRuntime struct {
4141

4242
var _ engine.RuntimeConfig = (*containerdCfgRuntime)(nil)
4343

44-
// GetBinaryPath retrieves the path to the actual low-level runtime binary invoked by the runtime handler
44+
// GetBinaryPath retrieves the path to the low-level runtime binary for a runtime.
45+
// If no path is available, the empty string is returned.
4546
func (c *containerdCfgRuntime) GetBinaryPath() string {
4647
if c == nil || c.tree == nil {
4748
return ""

pkg/config/engine/crio/crio.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ type crioRuntime struct {
3636

3737
var _ engine.RuntimeConfig = (*crioRuntime)(nil)
3838

39-
// GetBinaryPath retrieves the path to the actual low-level runtime binary invoked by the runtime handler
39+
// GetBinaryPath retrieves the path to the low-level runtime binary for a runtime.
40+
// If no path is available, the empty string is returned.
4041
func (c *crioRuntime) GetBinaryPath() string {
4142
if c.tree != nil {
4243
if binaryPath, ok := c.tree.GetPath([]string{"runtime_path"}).(string); ok {

pkg/config/engine/docker/docker.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ type dockerRuntime map[string]interface{}
3939

4040
var _ engine.RuntimeConfig = (*dockerRuntime)(nil)
4141

42-
// GetBinaryPath retrieves the path to the actual low-level runtime binary invoked by the runtime handler
42+
// GetBinaryPath retrieves the path to the low-level runtime binary for a runtime.
43+
// If no path is available, the empty string is returned.
4344
func (d dockerRuntime) GetBinaryPath() string {
4445
if d == nil {
4546
return ""

tools/container/nvidia-toolkit/run.go

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import (
99
"syscall"
1010

1111
log "github.com/sirupsen/logrus"
12-
cli "github.com/urfave/cli/v2"
13-
unix "golang.org/x/sys/unix"
12+
"github.com/urfave/cli/v2"
13+
"golang.org/x/sys/unix"
1414

1515
"github.com/NVIDIA/nvidia-container-toolkit/tools/container/runtime"
1616
"github.com/NVIDIA/nvidia-container-toolkit/tools/container/toolkit"
@@ -19,12 +19,10 @@ import (
1919
const (
2020
toolkitPidFilename = "toolkit.pid"
2121
defaultPidFile = "/run/nvidia/toolkit/" + toolkitPidFilename
22-
toolkitCommand = "toolkit"
2322
toolkitSubDir = "toolkit"
2423

25-
defaultRuntime = "docker"
26-
defaultRuntimeArgs = ""
27-
defaultHostRootMount = "/host"
24+
defaultRuntime = "docker"
25+
defaultRuntimeArgs = ""
2826
)
2927

3028
var availableRuntimes = map[string]struct{}{"docker": {}, "crio": {}, "containerd": {}}
@@ -192,7 +190,7 @@ func Run(c *cli.Context, o *options) error {
192190
}
193191

194192
// ParseArgs checks if a single positional argument was defined and extracts this the root.
195-
// If no positional arguments are defined, the it is assumed that the root is specified as a flag.
193+
// If no positional arguments are defined, it is assumed that the root is specified as a flag.
196194
func ParseArgs(args []string) ([]string, string, error) {
197195
log.Infof("Parsing arguments")
198196

0 commit comments

Comments
 (0)