fix: complete hardware collection diagnostics
This commit is contained in:
@@ -232,6 +232,11 @@ func ApplySATResultToDB(db *ComponentStatusDB, target, archivePath string) {
|
||||
if overall == "" {
|
||||
return
|
||||
}
|
||||
// An unsupported pack did not exercise a component. In particular, a
|
||||
// non-GPU host must not acquire a fictitious "pcie:gpu:nvidia" record.
|
||||
if overall == "UNSUPPORTED" {
|
||||
return
|
||||
}
|
||||
|
||||
source := "sat:" + target
|
||||
dbStatus := satStatusToDBStatus(overall)
|
||||
|
||||
@@ -642,6 +642,7 @@ func writeManifest(dst, exportDir, stageRoot string) error {
|
||||
}
|
||||
var body strings.Builder
|
||||
fmt.Fprintf(&body, "bee_version=%s\n", buildVersion())
|
||||
fmt.Fprintf(&body, "bee_git_commit=%s\n", buildCommit())
|
||||
fmt.Fprintf(&body, "host=%s\n", hostnameOr("unknown"))
|
||||
fmt.Fprintf(&body, "generated_at_utc=%s\n", time.Now().UTC().Format(time.RFC3339))
|
||||
fmt.Fprintf(&body, "export_dir=%s\n", exportDir)
|
||||
@@ -747,6 +748,16 @@ func buildVersion() string {
|
||||
return strings.TrimSpace(string(raw))
|
||||
}
|
||||
|
||||
func buildCommit() string {
|
||||
ctx, cancel := context.WithTimeout(context.Background(), defaultCommandTimeout)
|
||||
defer cancel()
|
||||
raw, err := exec.CommandContext(ctx, "bee", "version", "--commit").CombinedOutput()
|
||||
if err != nil || strings.TrimSpace(string(raw)) == "" {
|
||||
return "unknown"
|
||||
}
|
||||
return strings.TrimSpace(string(raw))
|
||||
}
|
||||
|
||||
func copyDirContents(srcDir, dstDir string) error {
|
||||
entries, err := os.ReadDir(srcDir)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user