logging + networking fix

This commit is contained in:
ari committed 2026-11-01 14:04:15 -05:00
1 parent 092ef6185f
commit 563dd7a759
4 files changed
+21 -4

No files matched your search

+14 -2
View File
@@ -4,6 +4,7 @@ import (
"context"
"errors"
"fmt"
"log"
"math"
"sort"
"sync"
@@ -210,7 +211,13 @@ func (m *Manager) Ensure(ctx context.Context, id string, kind model.OwnerKind) (
if !v.Used.Add(u.Size).Fits(v.Usable) {
return u, &node.NodeFullError{Node: u.Node}
}
return u, n.Start(ctx, m.spec(u))
log.Printf("container: starting %s for %s %s on %s (drive %s, %s)", u.Machine, u.Kind, u.ID, u.Node, u.Drive, u.Size)
if err := n.Start(ctx, m.spec(u)); err != nil {
log.Printf("container: starting %s on %s failed: %v", u.Machine, u.Node, err)
return u, err
}
log.Printf("container: %s is running on %s", u.Machine, u.Node)
return u, nil
}
// The old home folder stays on its node, untouched.
@@ -253,7 +260,12 @@ func (m *Manager) Poweroff(ctx context.Context, u *model.Owner) error {
if err != nil {
return err
}
return n.Poweroff(ctx, u.Machine)
log.Printf("container: shutting down %s for %s %s on %s", u.Machine, u.Kind, u.ID, u.Node)
if err := n.Poweroff(ctx, u.Machine); err != nil {
log.Printf("container: shutting down %s on %s failed: %v", u.Machine, u.Node, err)
return err
}
return nil
}
func (m *Manager) RunningOwners(ctx context.Context) []model.Owner {