feat: patch scheduler loop; record patch results and verify reboots from the agent stream
This commit is contained in:
@@ -236,6 +236,12 @@ func (s *vantageServer) ReportInventory(ctx context.Context, req *pb.InventoryRe
|
||||
if err := services.StoreInventory(srv.ServerID, req); err != nil {
|
||||
log.Printf("store inventory for %s: %v", srv.ServerID, err)
|
||||
}
|
||||
// Only static snapshots compute reboot_required, so only they can settle a
|
||||
// reboot. The agent sends one at start, so the first report after a
|
||||
// reboot qualifies.
|
||||
if req.IncludeStatic && req.BootTimeUnix > 0 {
|
||||
services.VerifyPatchReboots(srv.InstanceID, srv.ServerID, time.Unix(req.BootTimeUnix, 0), req.RebootRequired)
|
||||
}
|
||||
return &pb.InventoryReportResponse{}, nil
|
||||
}
|
||||
|
||||
@@ -330,6 +336,9 @@ func (s *vantageServer) CommandStream(stream pb.Vantage_CommandStreamServer) err
|
||||
if m.WorkloadLogsResult != nil {
|
||||
services.WorkloadResults.Deliver(m.WorkloadLogsResult)
|
||||
}
|
||||
if m.PatchResult != nil {
|
||||
services.RecordPatchResult(srv.InstanceID, srv.ServerID, m.PatchResult)
|
||||
}
|
||||
if m.StepResult != nil {
|
||||
services.StepResults.Deliver(m.StepResult)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user