zones: add logger to Zone and Machine

Signed-off-by: Alejandro Mery <amery@jpi.io>
This commit is contained in:
2023-09-07 14:51:01 +00:00
parent 5e5958d22e
commit 1bca1f7da1
3 changed files with 9 additions and 4 deletions
+2
View File
@@ -10,6 +10,8 @@ import (
// A Machine is a machine on a Zone
type Machine struct {
zone *Zone
logger
ID int `toml:"id"`
Name string `toml:"-" json:"-" yaml:"-"`
+2
View File
@@ -33,6 +33,7 @@ func (m *Zones) scanDirectory(_ *ScanOptions) error {
if e.IsDir() {
z := &Zone{
zones: m,
logger: m,
Name: e.Name(),
}
@@ -133,6 +134,7 @@ func (z *Zone) scan() error {
if e.IsDir() {
m := &Machine{
zone: z,
logger: z,
Name: e.Name(),
}
+1
View File
@@ -88,6 +88,7 @@ func FilterMachines(m MachineIterator, cond func(*Machine) bool) (Machines, int)
// Zone represents one zone in a cluster
type Zone struct {
zones *Zones
logger
ID int `toml:"id"`
Name string `toml:"name"`