Skip to content
This repository has been archived by the owner on May 12, 2021. It is now read-only.

Commit

Permalink
Merge pull request #814 from amshinde/fix-endpoint-indexing
Browse files Browse the repository at this point in the history
network: Sort endpoints by name
  • Loading branch information
amshinde committed 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
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.