software steht so weit.
jetzt build + docker build und testen
This commit is contained in:
1 parent
42f0c0accb
commit
ca6cdcca63
90 files changed
+10298
-480
No files matched your search
+11
-2
@@ -30,6 +30,9 @@ type Node struct {
|
||||
LastSeen time.Time
|
||||
IPAddress string
|
||||
Status NodeStatus
|
||||
// Maintenance ist die angemeldete Wartung (nil = keine). Sie ist eine
|
||||
// eigene Dimension: Ein Knoten in Wartung kann verbunden sein oder nicht.
|
||||
Maintenance *Maintenance
|
||||
}
|
||||
|
||||
func (n *Node) normalize(now time.Time) error {
|
||||
@@ -79,11 +82,17 @@ func (s *Store) insertNode(ctx context.Context, db execer, n Node) (Node, error)
|
||||
return n, nil
|
||||
}
|
||||
|
||||
const nodeColumns = `id, tenant_id, hostname, public_key, last_seen, ip_address, status`
|
||||
const nodeColumns = `id, tenant_id, hostname, public_key, last_seen, ip_address, status,
|
||||
maintenance_since, maintenance_until, maintenance_reason, maintenance_public_reason`
|
||||
|
||||
func scanNode(row interface{ Scan(...any) error }) (Node, error) {
|
||||
var n Node
|
||||
err := row.Scan(&n.ID, &n.TenantID, &n.Hostname, &n.PublicKey, dbTime{&n.LastSeen}, &n.IPAddress, &n.Status)
|
||||
var m Maintenance
|
||||
err := row.Scan(&n.ID, &n.TenantID, &n.Hostname, &n.PublicKey, dbTime{&n.LastSeen}, &n.IPAddress, &n.Status,
|
||||
dbTime{&m.Since}, dbTime{&m.Until}, &m.Reason, &m.PublicReason)
|
||||
if err == nil && !m.Since.IsZero() {
|
||||
n.Maintenance = &m
|
||||
}
|
||||
return n, err
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user