mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-09-26 03:03:52 +00:00
Merge pull request #814 from amshinde/fix-endpoint-indexing
network: Sort endpoints by name
This commit is contained in:
@@ -16,6 +16,7 @@ import (
|
|||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"runtime"
|
"runtime"
|
||||||
|
"sort"
|
||||||
"strings"
|
"strings"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -1670,6 +1671,12 @@ func createEndpointsFromScan(networkNSPath string, config NetworkConfig) ([]Endp
|
|||||||
idx++
|
idx++
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sort.Slice(endpoints, func(i, j int) bool {
|
||||||
|
return endpoints[i].Name() < endpoints[j].Name()
|
||||||
|
})
|
||||||
|
|
||||||
|
networkLogger().WithField("endpoints", endpoints).Info("Endpoints found after scan")
|
||||||
|
|
||||||
return endpoints, nil
|
return endpoints, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user