Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove redundant function (needs Go >= 1.23) #4387

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
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
Loading