mirror of
https://github.com/NVIDIA/nvidia-container-toolkit
synced 2024-11-25 21:39:10 +00:00
Merge pull request #577 from tariq1890/no-map-ptr
avoid using map pointers as maps are always passed by reference
This commit is contained in:
commit
6732f6d13b
@ -25,14 +25,14 @@ const (
|
|||||||
)
|
)
|
||||||
|
|
||||||
// Runtime defines a runtime to be configured.
|
// Runtime defines a runtime to be configured.
|
||||||
// The path and whether the runtime is the default runtime can be specfied
|
// The path and whether the runtime is the default runtime can be specified
|
||||||
type Runtime struct {
|
type Runtime struct {
|
||||||
name string
|
name string
|
||||||
Path string
|
Path string
|
||||||
SetAsDefault bool
|
SetAsDefault bool
|
||||||
}
|
}
|
||||||
|
|
||||||
// Runtimes defines a set of runtimes to be configure for use in the GPU Operator
|
// Runtimes defines a set of runtimes to be configured for use in the GPU Operator
|
||||||
type Runtimes map[string]Runtime
|
type Runtimes map[string]Runtime
|
||||||
|
|
||||||
type config struct {
|
type config struct {
|
||||||
@ -76,8 +76,8 @@ func (r Runtimes) DefaultRuntimeName() string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add a runtime to the set of runtimes.
|
// Add a runtime to the set of runtimes.
|
||||||
func (r *Runtimes) add(runtime Runtime) {
|
func (r Runtimes) add(runtime Runtime) {
|
||||||
(*r)[runtime.name] = runtime
|
r[runtime.name] = runtime
|
||||||
}
|
}
|
||||||
|
|
||||||
// nvidiaRuntime creates a runtime that corresponds to the nvidia runtime.
|
// nvidiaRuntime creates a runtime that corresponds to the nvidia runtime.
|
||||||
|
Loading…
Reference in New Issue
Block a user