From 12dc12ce097831cf82a504bd437a5232de103d93 Mon Sep 17 00:00:00 2001 From: Evan Lezar Date: Fri, 25 Aug 2023 16:14:06 +0200 Subject: [PATCH] Fix misspellings Signed-off-by: Evan Lezar --- cmd/nvidia-container-runtime-hook/container_config_test.go | 6 +++--- cmd/nvidia-ctk/hook/chmod/chmod.go | 2 +- cmd/nvidia-ctk/hook/create-symlinks/create-symlinks.go | 2 +- cmd/nvidia-ctk/hook/update-ldcache/update-ldcache.go | 2 +- internal/config/image/capabilities.go | 2 +- internal/config/image/cuda_image.go | 6 +++--- internal/discover/list.go | 2 +- internal/info/proc/information_files.go | 2 +- internal/ldcache/ldcache.go | 2 +- internal/modifier/cdi.go | 2 +- internal/oci/runtime_path.go | 2 +- internal/oci/spec.go | 2 +- internal/oci/spec_file.go | 2 +- pkg/nvcdi/driver-nvml.go | 2 +- pkg/nvcdi/lib-nvml.go | 2 +- pkg/nvcdi/spec/builder.go | 2 +- tools/container/nvidia-toolkit/run.go | 2 +- tools/container/toolkit/runtime.go | 2 +- 18 files changed, 22 insertions(+), 22 deletions(-) diff --git a/cmd/nvidia-container-runtime-hook/container_config_test.go b/cmd/nvidia-container-runtime-hook/container_config_test.go index c918bf06..2e5ec98b 100644 --- a/cmd/nvidia-container-runtime-hook/container_config_test.go +++ b/cmd/nvidia-container-runtime-hook/container_config_test.go @@ -1015,14 +1015,14 @@ func TestGetDriverCapabilities(t *testing.T) { for _, tc := range testCases { t.Run(tc.description, func(t *testing.T) { - var capabilites string + var capabilities string c := HookConfig{ SupportedDriverCapabilities: tc.supportedCapabilities, } getDriverCapabilities := func() { - capabilites = c.getDriverCapabilities(tc.env, tc.legacyImage).String() + capabilities = c.getDriverCapabilities(tc.env, tc.legacyImage).String() } if tc.expectedPanic { @@ -1031,7 +1031,7 @@ func TestGetDriverCapabilities(t *testing.T) { } getDriverCapabilities() - require.EqualValues(t, tc.expectedCapabilities, capabilites) + require.EqualValues(t, tc.expectedCapabilities, capabilities) }) } } diff --git a/cmd/nvidia-ctk/hook/chmod/chmod.go b/cmd/nvidia-ctk/hook/chmod/chmod.go index 4f2f28e1..1276f7fa 100644 --- a/cmd/nvidia-ctk/hook/chmod/chmod.go +++ b/cmd/nvidia-ctk/hook/chmod/chmod.go @@ -66,7 +66,7 @@ func (m command) build() *cli.Command { c.Flags = []cli.Flag{ &cli.StringSliceFlag{ Name: "path", - Usage: "Specifiy a path to apply the specified mode to", + Usage: "Specify a path to apply the specified mode to", Destination: &cfg.paths, }, &cli.StringFlag{ diff --git a/cmd/nvidia-ctk/hook/create-symlinks/create-symlinks.go b/cmd/nvidia-ctk/hook/create-symlinks/create-symlinks.go index 16ef3ed5..b57b4cd8 100644 --- a/cmd/nvidia-ctk/hook/create-symlinks/create-symlinks.go +++ b/cmd/nvidia-ctk/hook/create-symlinks/create-symlinks.go @@ -56,7 +56,7 @@ func (m command) build() *cli.Command { // Create the '' command c := cli.Command{ Name: "create-symlinks", - Usage: "A hook to create symlinks in the container. This can be used to proces CSV mount specs", + Usage: "A hook to create symlinks in the container. This can be used to process CSV mount specs", Action: func(c *cli.Context) error { return m.run(c, &cfg) }, diff --git a/cmd/nvidia-ctk/hook/update-ldcache/update-ldcache.go b/cmd/nvidia-ctk/hook/update-ldcache/update-ldcache.go index a0267297..f9719e64 100644 --- a/cmd/nvidia-ctk/hook/update-ldcache/update-ldcache.go +++ b/cmd/nvidia-ctk/hook/update-ldcache/update-ldcache.go @@ -60,7 +60,7 @@ func (m command) build() *cli.Command { c.Flags = []cli.Flag{ &cli.StringSliceFlag{ Name: "folder", - Usage: "Specifiy a folder to add to /etc/ld.so.conf before updating the ld cache", + Usage: "Specify a folder to add to /etc/ld.so.conf before updating the ld cache", Destination: &cfg.folders, }, &cli.StringFlag{ diff --git a/internal/config/image/capabilities.go b/internal/config/image/capabilities.go index 9c05acc0..824a6db9 100644 --- a/internal/config/image/capabilities.go +++ b/internal/config/image/capabilities.go @@ -73,7 +73,7 @@ func (c DriverCapabilities) Has(capability DriverCapability) bool { return c[capability] } -// Any checks whether any of the specified capabilites are set +// Any checks whether any of the specified capabilities are set func (c DriverCapabilities) Any(capabilities ...DriverCapability) bool { if c.IsAll() { return true diff --git a/internal/config/image/cuda_image.go b/internal/config/image/cuda_image.go index f7a6713b..ee264001 100644 --- a/internal/config/image/cuda_image.go +++ b/internal/config/image/cuda_image.go @@ -139,12 +139,12 @@ func (i CUDA) DevicesFromEnvvars(envVars ...string) VisibleDevices { func (i CUDA) GetDriverCapabilities() DriverCapabilities { env := i[envNVDriverCapabilities] - capabilites := make(DriverCapabilities) + capabilities := make(DriverCapabilities) for _, c := range strings.Split(env, ",") { - capabilites[DriverCapability(c)] = true + capabilities[DriverCapability(c)] = true } - return capabilites + return capabilities } func (i CUDA) legacyVersion() (string, error) { diff --git a/internal/discover/list.go b/internal/discover/list.go index aa0c5910..8fbf6e75 100644 --- a/internal/discover/list.go +++ b/internal/discover/list.go @@ -27,7 +27,7 @@ type list struct { var _ Discover = (*list)(nil) -// Merge creates a discoverer that is the composite of a list of discoveres. +// Merge creates a discoverer that is the composite of a list of discoverers. func Merge(d ...Discover) Discover { l := list{ discoverers: d, diff --git a/internal/info/proc/information_files.go b/internal/info/proc/information_files.go index dde77416..f84b76a6 100644 --- a/internal/info/proc/information_files.go +++ b/internal/info/proc/information_files.go @@ -56,7 +56,7 @@ func ParseGPUInformationFile(path string) (GPUInfo, error) { } // gpuInfoFrom parses a GPUInfo struct from the specified reader -// An information file has the following strucutre: +// An information file has the following structure: // $ cat /proc/driver/nvidia/gpus/0000\:06\:00.0/information // Model: Tesla V100-SXM2-16GB // IRQ: 408 diff --git a/internal/ldcache/ldcache.go b/internal/ldcache/ldcache.go index 7673a49a..0547dee4 100644 --- a/internal/ldcache/ldcache.go +++ b/internal/ldcache/ldcache.go @@ -234,7 +234,7 @@ func (c *ldcache) getEntries(selected func(string) bool) []entry { return entries } -// List creates a list of libraires in the ldcache. +// List creates a list of libraries in the ldcache. // The 32-bit and 64-bit libraries are returned separately. func (c *ldcache) List() ([]string, []string) { all := func(s string) bool { return true } diff --git a/internal/modifier/cdi.go b/internal/modifier/cdi.go index 3fb44221..7cef3672 100644 --- a/internal/modifier/cdi.go +++ b/internal/modifier/cdi.go @@ -29,7 +29,7 @@ import ( ) // NewCDIModifier creates an OCI spec modifier that determines the modifications to make based on the -// CDI specifications available on the system. The NVIDIA_VISIBLE_DEVICES enviroment variable is +// CDI specifications available on the system. The NVIDIA_VISIBLE_DEVICES environment variable is // used to select the devices to include. func NewCDIModifier(logger logger.Interface, cfg *config.Config, ociSpec oci.Spec) (oci.SpecModifier, error) { devices, err := getDevicesFromSpec(logger, ociSpec, cfg) diff --git a/internal/oci/runtime_path.go b/internal/oci/runtime_path.go index 948312f3..3c43f31d 100644 --- a/internal/oci/runtime_path.go +++ b/internal/oci/runtime_path.go @@ -23,7 +23,7 @@ import ( "github.com/NVIDIA/nvidia-container-toolkit/internal/logger" ) -// pathRuntime wraps the path that a binary and defines the semanitcs for how to exec into it. +// pathRuntime wraps the path that a binary and defines the semantics for how to exec into it. // This can be used to wrap an OCI-compliant low-level runtime binary, allowing it to be used through the // Runtime internface. type pathRuntime struct { diff --git a/internal/oci/spec.go b/internal/oci/spec.go index dedf794c..f433e1c4 100644 --- a/internal/oci/spec.go +++ b/internal/oci/spec.go @@ -23,7 +23,7 @@ import ( "github.com/opencontainers/runtime-spec/specs-go" ) -// SpecModifier defines an interace for modifying a (raw) OCI spec +// SpecModifier defines an interface for modifying a (raw) OCI spec type SpecModifier interface { // Modify is a method that accepts a pointer to an OCI Srec and returns an // error. The intention is that the function would modify the spec in-place. diff --git a/internal/oci/spec_file.go b/internal/oci/spec_file.go index 7fba130d..8784ae92 100644 --- a/internal/oci/spec_file.go +++ b/internal/oci/spec_file.go @@ -79,7 +79,7 @@ func (s *fileSpec) Modify(m SpecModifier) error { return s.memorySpec.Modify(m) } -// Flush writes the stored OCI specification to the filepath specifed by the path member. +// Flush writes the stored OCI specification to the filepath specified by the path member. // The file is truncated upon opening, overwriting any existing contents. func (s fileSpec) Flush() error { if s.Spec == nil { diff --git a/pkg/nvcdi/driver-nvml.go b/pkg/nvcdi/driver-nvml.go index bc8171a3..89349b27 100644 --- a/pkg/nvcdi/driver-nvml.go +++ b/pkg/nvcdi/driver-nvml.go @@ -34,7 +34,7 @@ import ( // The supplied NVML Library is used to query the expected driver version. func NewDriverDiscoverer(logger logger.Interface, driverRoot string, nvidiaCTKPath string, nvmllib nvml.Interface) (discover.Discover, error) { if r := nvmllib.Init(); r != nvml.SUCCESS { - return nil, fmt.Errorf("failed to initalize NVML: %v", r) + return nil, fmt.Errorf("failed to initialize NVML: %v", r) } defer nvmllib.Shutdown() diff --git a/pkg/nvcdi/lib-nvml.go b/pkg/nvcdi/lib-nvml.go index 95ccf66b..1a43cdb7 100644 --- a/pkg/nvcdi/lib-nvml.go +++ b/pkg/nvcdi/lib-nvml.go @@ -41,7 +41,7 @@ func (l *nvmllib) GetAllDeviceSpecs() ([]specs.Device, error) { var deviceSpecs []specs.Device if r := l.nvmllib.Init(); r != nvml.SUCCESS { - return nil, fmt.Errorf("failed to initalize NVML: %v", r) + return nil, fmt.Errorf("failed to initialize NVML: %v", r) } defer l.nvmllib.Shutdown() diff --git a/pkg/nvcdi/spec/builder.go b/pkg/nvcdi/spec/builder.go index 0a867a55..bfefff93 100644 --- a/pkg/nvcdi/spec/builder.go +++ b/pkg/nvcdi/spec/builder.go @@ -85,7 +85,7 @@ func (o *builder) Build() (*spec, error) { if raw.Version == DetectMinimumVersion { minVersion, err := cdi.MinimumRequiredVersion(raw) if err != nil { - return nil, fmt.Errorf("failed to get minumum required CDI spec version: %v", err) + return nil, fmt.Errorf("failed to get minimum required CDI spec version: %v", err) } raw.Version = minVersion } diff --git a/tools/container/nvidia-toolkit/run.go b/tools/container/nvidia-toolkit/run.go index 78efd9a1..740835b3 100644 --- a/tools/container/nvidia-toolkit/run.go +++ b/tools/container/nvidia-toolkit/run.go @@ -65,7 +65,7 @@ func main() { &cli.BoolFlag{ Name: "no-daemon", Aliases: []string{"n"}, - Usage: "terminate immediatly after setting up the runtime. Note that no cleanup will be performed", + Usage: "terminate immediately after setting up the runtime. Note that no cleanup will be performed", Destination: &options.noDaemon, EnvVars: []string{"NO_DAEMON"}, }, diff --git a/tools/container/toolkit/runtime.go b/tools/container/toolkit/runtime.go index 92195975..d2e0b69f 100644 --- a/tools/container/toolkit/runtime.go +++ b/tools/container/toolkit/runtime.go @@ -43,7 +43,7 @@ func installContainerRuntimes(toolkitDir string, driverRoot string) error { } // newNVidiaContainerRuntimeInstaller returns a new executable installer for the NVIDIA container runtime. -// This installer will copy the specified source exectuable to the toolkit directory. +// This installer will copy the specified source executable to the toolkit directory. // The executable is copied to a file with the same name as the source, but with a ".real" suffix and a wrapper is // created to allow for the configuration of the runtime environment. func newNvidiaContainerRuntimeInstaller(source string) *executable {