hub (unreleased): the System page shows the kernel clean-up and the security-profile refresh; a clean-up no longer hides a kernel step (R-1383)
gates / gates (push) Successful in 2m20s
gates / gates (push) Successful in 2m20s
Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
1 parent
e5c643d73d
commit
68292e40f6
14 files changed
+452
-13
No files matched your search
@@ -480,6 +480,12 @@ type KernelLine struct {
|
||||
NoticeAt time.Time // the newest day-before mail (any kernel)
|
||||
NoticeKver string
|
||||
Tonight bool
|
||||
// The newest clean-up of old kernels (R-1383, release 3), kept APART from the step: both are kernel-layer
|
||||
// reports, and before this the newest of the two was shown as „the step” — a clean-up hid a kernel that fell back.
|
||||
CleanupOutcome string // cleaned | refused | failed; "" = none reported
|
||||
CleanupAt time.Time
|
||||
CleanupReason string
|
||||
Cleanup *CleanupDetail // nil = an agent older than release 3 (the reason text carries the names)
|
||||
}
|
||||
|
||||
// KernelLineFor reads one box's kernel line.
|
||||
@@ -489,12 +495,33 @@ func (s *Service) KernelLineFor(hostID string) KernelLine {
|
||||
if b := s.KernelBlockFor(hostID); b != nil {
|
||||
l.Tonight = b.Tonight
|
||||
}
|
||||
if rep, _ := s.Store.LatestOSReport(hostID, LayerKernel); rep != nil {
|
||||
// The newest STEP and the newest CLEAN-UP, each from its own report (newest first; 100 covers months).
|
||||
reps, _ := s.Store.OSReportsDesc(hostID, LayerKernel, 100)
|
||||
haveStep, haveCleanup := false, false
|
||||
for _, rep := range reps {
|
||||
if haveStep && haveCleanup {
|
||||
break
|
||||
}
|
||||
var kr Report
|
||||
_ = json.Unmarshal([]byte(rep.ReportJSON), &kr)
|
||||
l.LastOutcome, l.LastKernel, l.LastAt, l.LastReason = rep.Outcome, kernelOf(kr), rep.ReceivedAt, kr.HealthReason
|
||||
if l.LastReason == "" && len(kr.Refused) > 0 {
|
||||
l.LastReason = string(kr.Refused)
|
||||
reason := kr.HealthReason
|
||||
if reason == "" && len(kr.Refused) > 0 {
|
||||
reason = string(kr.Refused)
|
||||
}
|
||||
if rep.Mode == ModeKernelCleanup {
|
||||
if !haveCleanup {
|
||||
haveCleanup = true
|
||||
l.CleanupOutcome, l.CleanupAt, l.CleanupReason = rep.Outcome, rep.ReceivedAt, reason
|
||||
var d CleanupDetail
|
||||
if len(kr.KernelCleanup) > 0 && json.Unmarshal(kr.KernelCleanup, &d) == nil {
|
||||
l.Cleanup = &d
|
||||
}
|
||||
}
|
||||
continue
|
||||
}
|
||||
if !haveStep {
|
||||
haveStep = true
|
||||
l.LastOutcome, l.LastKernel, l.LastAt, l.LastReason = rep.Outcome, kernelOf(kr), rep.ReceivedAt, reason
|
||||
}
|
||||
}
|
||||
if n, _ := s.Store.LatestKernelNotice(hostID); n != nil {
|
||||
|
||||
Reference in new issue
Block a user