Skip to content

Commit

Permalink
more elegant?
Browse files Browse the repository at this point in the history
  • Loading branch information
pkazmierczak committed Nov 13, 2024
1 parent 8f492bc commit f0143db
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions drivers/shared/capabilities/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,14 @@ func NomadDefaults() *Set {
func Supported() *Set {
s := New(nil)

list, _ := capability.ListSupported()

// capability.ListSupported() will always return an empty list on non-linux
// systems
if runtime.GOOS != "linux" {
var list []capability.Cap

switch runtime.GOOS {
case "linux":
list, _ = capability.ListSupported()
default:
// capability.ListSupported() will always return an empty list on
// non-linux systems
list = capability.ListKnown()
}

Expand Down

0 comments on commit f0143db

Please sign in to comment.