hub v0.133.0 (R-859 test approvals end with the test; R-840 bundle on the System page, manifest, alarm); installer 1.31.0 (root files from the config bundle); bundle bootstrap script; golden 0.293.0 evidence; rulings 96–99; drill-r50 removed (evidence)
gates / gates (push) Successful in 29s
gates / gates (push) Successful in 29s
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0159rPz1ZhFKsS53msqPYxtS
This commit is contained in:
1 parent
6b820143f8
commit
ff1db11db4
45 files changed
+1707
-42
No files matched your search
@@ -50,6 +50,15 @@ type Guest struct {
|
||||
UnknownReason string `json:"unknown_reason"`
|
||||
}
|
||||
|
||||
// ConfigBundle is the box's root-owned config bundle (R-840, agent v0.143.0): the agent's own read of the record
|
||||
// (version "none" = no bundle ever reached the box), with the drift the wrapper's facts add (files changed by hand).
|
||||
type ConfigBundle struct {
|
||||
Version string `json:"version"` // agent version of the bundle | none | unknown
|
||||
BundleSHA256 string `json:"bundle_sha256"`
|
||||
InstalledAt string `json:"installed_at"`
|
||||
Drift []string `json:"drift"`
|
||||
}
|
||||
|
||||
// System is the whole stanza. Present is false for a report from an agent older than v0.142.0.
|
||||
type System struct {
|
||||
Present bool
|
||||
@@ -60,6 +69,7 @@ type System struct {
|
||||
ReadAt string
|
||||
Host Host
|
||||
Guest Guest
|
||||
Bundle ConfigBundle
|
||||
}
|
||||
|
||||
type wire struct {
|
||||
@@ -70,6 +80,7 @@ type wire struct {
|
||||
Facts json.RawMessage `json:"facts"`
|
||||
FactsError string `json:"facts_error"`
|
||||
ReadAt string `json:"read_at"`
|
||||
ConfigBundle *ConfigBundle `json:"config_bundle"`
|
||||
} `json:"system"`
|
||||
}
|
||||
|
||||
@@ -93,11 +104,25 @@ func Parse(reportJSON string) System {
|
||||
out.PVEVersion, out.KernelVersion = orUnknown(w.System.PVEVersion), orUnknown(w.System.KernelVersion)
|
||||
out.VMID, out.FactsError, out.ReadAt = w.System.VMID, w.System.FactsError, w.System.ReadAt
|
||||
var f struct {
|
||||
Host Host `json:"host"`
|
||||
Host struct {
|
||||
Host
|
||||
ConfigBundle *ConfigBundle `json:"config_bundle"`
|
||||
} `json:"host"`
|
||||
Guest Guest `json:"guest"`
|
||||
}
|
||||
out.Bundle = ConfigBundle{Version: Unknown}
|
||||
if w.System.ConfigBundle != nil && w.System.ConfigBundle.Version != "" {
|
||||
out.Bundle = *w.System.ConfigBundle
|
||||
}
|
||||
if len(w.System.Facts) > 0 && json.Unmarshal(w.System.Facts, &f) == nil {
|
||||
out.Host, out.Guest = f.Host, f.Guest
|
||||
out.Host, out.Guest = f.Host.Host, f.Guest
|
||||
// The wrapper's view adds the drift; its record is the same file the agent read.
|
||||
if fb := f.Host.ConfigBundle; fb != nil && fb.Version != "" && fb.Version != Unknown {
|
||||
if out.Bundle.Version == Unknown {
|
||||
out.Bundle = *fb
|
||||
}
|
||||
out.Bundle.Drift = fb.Drift
|
||||
}
|
||||
}
|
||||
out.Host.Debian, out.Host.KernelRunning = orUnknown(out.Host.Debian), orUnknown(out.Host.KernelRunning)
|
||||
out.Host.KernelNextBoot = orUnknown(out.Host.KernelNextBoot)
|
||||
|
||||
Reference in new issue
Block a user