Skip to content

Commit

Permalink
Remove redundant function
Browse files Browse the repository at this point in the history
  • Loading branch information
BooleanCat committed Aug 30, 2024
1 parent 346b818 commit 73599a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 13 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/opencontainers/runc

go 1.22
go 1.23

require (
github.com/checkpoint-restore/go-criu/v6 v6.3.0
Expand Down
15 changes: 3 additions & 12 deletions libcontainer/capabilities/capabilities.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
package capabilities

import (
"sort"
"maps"
"slices"
"strings"

"github.com/opencontainers/runc/libcontainer/configs"
Expand Down Expand Up @@ -69,7 +70,7 @@ func New(capConfig *configs.Capabilities) (*Caps, error) {
return nil, err
}
if len(unknownCaps) > 0 {
logrus.Warn("ignoring unknown or unavailable capabilities: ", mapKeys(unknownCaps))
logrus.Warn("ignoring unknown or unavailable capabilities: ", slices.Sorted(maps.Keys(unknownCaps)))
}
return &c, nil
}
Expand All @@ -89,16 +90,6 @@ func capSlice(caps []string, unknownCaps map[string]struct{}) []capability.Cap {
return out
}

// mapKeys returns the keys of input in sorted order
func mapKeys(input map[string]struct{}) []string {
var keys []string
for c := range input {
keys = append(keys, c)
}
sort.Strings(keys)
return keys
}

// Caps holds the capabilities for a container.
type Caps struct {
pid capability.Capabilities
Expand Down

0 comments on commit 73599a1

Please sign in to comment.