Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions pkg/config/engine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import "strings"
// the default runtime, "runc", and "crun"
//
// If an nvidia* runtime is set as the default runtime, this is ignored.
func GetBinaryPathsForRuntimes(cfg Interface) []string {
func GetBinaryPathsForRuntimes(cfg defaultRuntimesGetter) []string {

var binaryPaths []string
seen := make(map[string]bool)
Expand All @@ -45,9 +45,14 @@ func GetBinaryPathsForRuntimes(cfg Interface) []string {
return binaryPaths
}

type defaultRuntimesGetter interface {
DefaultRuntime() string
GetRuntimeConfig(string) (RuntimeConfig, error)
}

// GetLowLevelRuntimes returns a predefined list low-level runtimes from the specified config.
// nvidia* runtimes are ignored.
func GetLowLevelRuntimes(cfg Interface) []string {
func GetLowLevelRuntimes(cfg defaultRuntimesGetter) []string {
var runtimes []string
isValidDefault := func(s string) bool {
if s == "" {
Expand Down
Loading