hub v0.181.0 (not deployed): root files are 'behind' only when the files differ (R-1392, decision 304); Go 1.27.4 (R-1391)
gates / gates (push) Successful in 1m55s

This commit is contained in:
admin committed 2026-11-14 10:11:31 +01:00
1 parent 561a4d98e9
commit 83316fc986
15 files changed
+442 -11

No files matched your search

+14 -3
View File
@@ -270,9 +270,10 @@ func guestTrimText(g sysfacts.GuestTrim, now time.Time) (text string, warn bool,
return text, warn, why
}
// bundleCell is the "Root files" cell (R-840): the box's config bundle against the vouched agent's. Amber while behind,
// bundleCell is the "Root files" cell (R-840): the box's config bundle against the vouched agent's. Amber while behind
// (never when the files are the same under another label — sameFiles, R-1392, pinned by TestBundleCell_R1392),
// red from the alarm's wait on, amber when a file was changed by hand (drift); "unknown" is never coloured as a fact.
func bundleCell(f sysfacts.System, vouchedAgent, vouchedSHA string, since time.Time, after time.Duration, now time.Time) cell {
func bundleCell(f sysfacts.System, vouchedAgent, vouchedSHA string, sameFiles bool, since time.Time, after time.Duration, now time.Time) cell {
b := f.Bundle
if !f.Present || b.Version == "" || b.Version == sysfacts.Unknown {
return unknownCell("")
@@ -281,6 +282,9 @@ func bundleCell(f sysfacts.System, vouchedAgent, vouchedSHA string, since time.T
switch {
case vouchedSHA == "":
c.Title = "no vouched bundle to compare with (the vouched agent carries none)"
case b.BundleSHA256 != vouchedSHA && sameFiles:
// R-1392: an agent release that changed no root file gives the bundle a new label and a new sha256.
c.Title = "the same files as the vouched agent " + vouchedAgent + "'s bundle (only the label differs)"
case b.BundleSHA256 != vouchedSHA:
c.Class, c.Title = "warn", "behind the vouched agent "+vouchedAgent+"'s bundle — send it with a signed agent_config_update"
if !since.IsZero() {
@@ -453,7 +457,7 @@ func (s *Server) handleSystem(w http.ResponseWriter, r *http.Request) {
hosts, _ := s.store.ListHosts()
now := time.Now()
in := systemInput{Lines: lines, Facts: map[string]sysfacts.System{}, Names: map[string]string{}, Controllers: map[string]string{},
Agents: map[string]string{}, KernelLines: map[string]osupdates.KernelLine{}, BundleSince: map[string]time.Time{},
Agents: map[string]string{}, KernelLines: map[string]osupdates.KernelLine{}, BundleSince: map[string]time.Time{}, BundleSame: map[string]bool{},
AgentSince: map[string]time.Time{}, BundleAfter: view.BundleThreshold(), AgentAfter: view.AgentThreshold(),
GlobalFloor: s.store.GetGlobalMinControllerVersion(), Releases: view.Releases(), Cancelled: view.CancelledReleases(),
Candidates: view.Candidates(), Now: now}
@@ -479,6 +483,13 @@ func (s *Server) handleSystem(w http.ResponseWriter, r *http.Request) {
}
man := s.store.GetArtifactManifest()
in.VouchedAgent, in.VouchedBundle = man.AgentVersion, man.BundleSHA256
if s.sameBundleFiles != nil && man.BundleSHA256 != "" {
for id, f := range in.Facts {
if b := f.Bundle; f.Present && b.BundleSHA256 != "" && b.BundleSHA256 != man.BundleSHA256 {
in.BundleSame[id] = s.sameBundleFiles(b.Version, b.BundleSHA256, man.AgentVersion, man.BundleSHA256)
}
}
}
ovs, oerr := s.store.CustomerFloorOverrides()
if oerr != nil {
s.logger.Printf("[ERROR] system page: floor overrides: %v", oerr)