zones: introduce Machines type. iterable and sortable

Signed-off-by: Alejandro Mery <amery@jpi.io>
This commit is contained in:
2023-08-27 16:08:00 +00:00
parent 2a14205e7e
commit 2224e70638
2 changed files with 42 additions and 17 deletions
+1 -6
View File
@@ -93,12 +93,7 @@ func (m *Zones) scanSort() error {
})
m.ForEachZone(func(z *Zone) bool {
sort.SliceStable(z.Machines, func(i, j int) bool {
id1 := z.Machines[i].ID
id2 := z.Machines[j].ID
return id1 < id2
})
sort.Sort(z)
return false
})