mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Sort drivers for nvproxy list-supported-drivers command.
Sort drivers for runsc command so that it is easier to find if a driver is supported or not. PiperOrigin-RevId: 659610598
This commit is contained in:
committed by
gVisor bot
parent
2ef09d3bdd
commit
5e00026dc9
@@ -17,6 +17,7 @@ package nvproxy
|
||||
import (
|
||||
"fmt"
|
||||
"reflect"
|
||||
"sort"
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
@@ -722,6 +723,19 @@ func LatestDriver() DriverVersion {
|
||||
return ret
|
||||
}
|
||||
|
||||
// SupportedDrivers returns a list of all supported drivers.
|
||||
// Precondition: Init() must have been called.
|
||||
func SupportedDrivers() []DriverVersion {
|
||||
var ret []DriverVersion
|
||||
for version := range abis {
|
||||
ret = append(ret, version)
|
||||
}
|
||||
sort.Slice(ret, func(i, j int) bool {
|
||||
return !ret[i].isGreaterThan(ret[j])
|
||||
})
|
||||
return ret
|
||||
}
|
||||
|
||||
// ExpectedDriverChecksum returns the expected checksum for a given version.
|
||||
// Precondition: Init() must have been called.
|
||||
func ExpectedDriverChecksum(version DriverVersion) (string, bool) {
|
||||
|
||||
@@ -53,9 +53,9 @@ func (*listSupportedDrivers) Execute(ctx context.Context, f *flag.FlagSet, args
|
||||
return subcommands.ExitUsageError
|
||||
}
|
||||
|
||||
nvproxy.ForEachSupportDriver(func(version nvproxy.DriverVersion, _ string) {
|
||||
fmt.Println(version)
|
||||
})
|
||||
for _, d := range nvproxy.SupportedDrivers() {
|
||||
fmt.Println(d)
|
||||
}
|
||||
|
||||
return subcommands.ExitSuccess
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user