Skip to content

Commit

Permalink
Merge pull request kata-containers#814 from amshinde/fix-endpoint-ind…
Browse files Browse the repository at this point in the history
…exing

network: Sort endpoints by name
  • Loading branch information
amshinde authored Oct 11, 2018
2 parents c3cfe82 + 8f1b28d commit 7fb2706
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions virtcontainers/network.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import (
"os"
"path/filepath"
"runtime"
"sort"
"strings"
"time"

Expand Down Expand Up @@ -1670,6 +1671,12 @@ func createEndpointsFromScan(networkNSPath string, config NetworkConfig) ([]Endp
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
}

Expand Down

0 comments on commit 7fb2706

Please sign in to comment.