summaryrefslogtreecommitdiff
path: root/pkg/rootless/rootless.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2021-05-05 13:22:10 -0400
committerGitHub <noreply@github.com>2021-05-05 13:22:10 -0400
commit9d6588bc86d3325db7294c03a3ab27347364bb64 (patch)
treee3421dfda4017e60398c4b8c1e01c102ec8d2caa /pkg/rootless/rootless.go
parent120e1b78ef28e9220337423ea3e11486c813aa55 (diff)
parentc2c0d5058203070033b2d2e84c8b168bd4060650 (diff)
downloadpodman-9d6588bc86d3325db7294c03a3ab27347364bb64.tar.gz
podman-9d6588bc86d3325db7294c03a3ab27347364bb64.tar.bz2
podman-9d6588bc86d3325db7294c03a3ab27347364bb64.zip
Merge pull request #10223 from giuseppe/improve-rootless-automatic-range-split
rootless: improve automatic range split
Diffstat (limited to 'pkg/rootless/rootless.go')
-rw-r--r--pkg/rootless/rootless.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/pkg/rootless/rootless.go b/pkg/rootless/rootless.go
index 0b9d719a9..93b4e2e9f 100644
--- a/pkg/rootless/rootless.go
+++ b/pkg/rootless/rootless.go
@@ -137,7 +137,7 @@ func GetAvailableGids() (int64, error) {
// It assumes availableMappings is sorted by ID.
func findIDInMappings(id int64, availableMappings []user.IDMap) *user.IDMap {
i := sort.Search(len(availableMappings), func(i int) bool {
- return availableMappings[i].ID >= id
+ return availableMappings[i].ID <= id
})
if i < 0 || i >= len(availableMappings) {
return nil
@@ -157,7 +157,7 @@ func MaybeSplitMappings(mappings []spec.LinuxIDMapping, availableMappings []user
overflow.Size = 0
consumed := 0
sort.Slice(availableMappings, func(i, j int) bool {
- return availableMappings[i].ID < availableMappings[j].ID
+ return availableMappings[i].ID > availableMappings[j].ID
})
for {
cur := overflow