Signed-off-by: Alejandro Mery <amery@jpi.io>
@ -31,6 +31,15 @@ type Zones struct {
Zones []*Zone `toml:"zones"`
}
// ForEachMachine calls a function for each Machine in the cluster
func (m *Zones) ForEachMachine(fn func(*Machine)) {
for _, z := range m.Zones {
for _, p := range z.Machines {
fn(p)
// NewFS builds a [Zones] tree using the given directory
func NewFS(dir fs.FS, domain string) (*Zones, error) {
z := &Zones{