diff --git a/go/svc/leasifier/main.go b/go/svc/leasifier/main.go index 09090b6e..a7ac49e9 100644 --- a/go/svc/leasifier/main.go +++ b/go/svc/leasifier/main.go @@ -8,6 +8,7 @@ import ( "io" "net" "os" + "sort" "strings" "time" @@ -164,6 +165,7 @@ func (s *service) work(ctx context.Context) { glog.Errorf("Could not parse lease file: %v", err) return } + sort.Slice(l, func(i, j int) bool { return string([]byte(l[i].ip)) < string([]byte(l[j].ip)) }) leases = l glog.Infof("Got %d leases", len(leases)) }