version mismatch catch

This commit is contained in:
ari committed 2026-11-01 14:34:23 -05:00
1 parent 3ba96528bb
commit a90653260a
11 files changed
+181 -34

No files matched your search

+9 -8
View File
@@ -35,17 +35,18 @@ const (
)
type Local struct {
cfg *config.Config
name string
cap Capacity
bus *dbus.Conn
system string
cfg *config.Config
name string
version string
cap Capacity
bus *dbus.Conn
system string
exports transfers
imports transfers
}
func New(cfg *config.Config) (*Local, error) {
func New(cfg *config.Config, version string) (*Local, error) {
system, err := filepath.EvalSymlinks(cfg.System)
if err != nil {
return nil, err
@@ -66,7 +67,7 @@ func New(cfg *config.Config) (*Local, error) {
if err != nil {
return nil, fmt.Errorf("connecting to the system bus: %w", err)
}
return &Local{cfg: cfg, name: cfg.Cluster.Name, cap: capacity, bus: bus, system: system}, nil
return &Local{cfg: cfg, name: cfg.Cluster.Name, version: version, cap: capacity, bus: bus, system: system}, nil
}
func unitName(machine string) string { return "slackerbot-" + machine + ".service" }
@@ -76,7 +77,7 @@ func (l *Local) Name() string { return l.name }
func (l *Local) machined() dbus.BusObject { return l.bus.Object(machinedName, machinedPath) }
func (l *Local) Info(ctx context.Context) (node.NodeInfo, error) {
info := node.NodeInfo{Name: l.name, Total: l.cap.Total, Usable: l.cap.Usable}
info := node.NodeInfo{Name: l.name, Version: l.version, Total: l.cap.Total, Usable: l.cap.Usable}
for _, d := range l.cfg.Drives {
free, err := storage.FreeMB(d.Path)
if err != nil {