Have a machine say what it is made of, and say it once a day unasked (issue 160)
The mesh knew a machine's architecture and kernel family and nothing it is made of, and heard even that only when it sent the machine something. The profile now carries the machine's memory, each local filesystem's size and free space, processor model, cores and threads, distribution and version, kernel release, virtual or physical, boot time and timezone; a fact it cannot read is named unknown with why, never zeroed. The reconcile says the profile unasked once the mesh last heard it 23 hours ago, so on a machine nobody pushed to nothing the mesh holds of it is older than a day.
This commit is contained in:
@@ -68,6 +68,9 @@ type Profile struct {
|
||||
Architecture string `json:"architecture"`
|
||||
Kernel string `json:"kernel"`
|
||||
Capabilities []Verdict `json:"capabilities"`
|
||||
// Machine is what it is made of (novox/hq issue 160), said with every profile: at enrolment, after
|
||||
// every apply, and by the reconcile once a day when nothing else made it speak.
|
||||
Machine *Machine `json:"machine,omitempty"`
|
||||
}
|
||||
|
||||
// Has reports whether a named capability is present. Unknown names are absent, not an error:
|
||||
@@ -114,5 +117,9 @@ func Detect(ctx context.Context, detectors []Detector, timeout time.Duration) Pr
|
||||
sort.Slice(p.Capabilities, func(i, j int) bool {
|
||||
return p.Capabilities[i].Name < p.Capabilities[j].Name
|
||||
})
|
||||
describeCtx, cancel := context.WithTimeout(ctx, timeout)
|
||||
m := DescribeMachine(describeCtx, RealSources())
|
||||
cancel()
|
||||
p.Machine = &m
|
||||
return p
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user