Harden worker federation and operator UI
This commit is contained in:
@@ -174,6 +174,14 @@ func putID[T any](m map[string]T, id, kind string) error {
|
||||
func (r Registry) Project(id string) (Project, bool) { p, ok := r.projects[id]; return p, ok }
|
||||
func (r Registry) Machine(id string) (Machine, bool) { m, ok := r.machines[id]; return m, ok }
|
||||
func (r Registry) Herdr(id string) (Herdr, bool) { h, ok := r.herdrs[id]; return h, ok }
|
||||
func (r Registry) Machines() []Machine {
|
||||
out := make([]Machine, 0, len(r.machines))
|
||||
for _, m := range r.machines {
|
||||
out = append(out, m)
|
||||
}
|
||||
sort.Slice(out, func(i, j int) bool { return out[i].ID < out[j].ID })
|
||||
return out
|
||||
}
|
||||
func (r Registry) Herdrs() []Herdr {
|
||||
out := make([]Herdr, 0, len(r.herdrs))
|
||||
for _, h := range r.herdrs {
|
||||
|
||||
Reference in New Issue
Block a user