Post-repair hardware validation pipeline for Proxmox cluster hosts. Go orchestrator + in-image agent + mkosi live image + bundled dnsmasq PXE + SQLite + HTMX/SSE UI + notify registry + janitor + full docs.
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
package tests
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
)
|
||||
|
||||
// readFile is used by stages that need to peek at /sys files without
|
||||
// importing the agent's probes package (which would cycle).
|
||||
func readFile(p string) ([]byte, error) {
|
||||
return os.ReadFile(p)
|
||||
}
|
||||
|
||||
// formatCount pluralizes a count + label: (0, "disk") → "0 disks",
|
||||
// (1, "disk") → "1 disk", (n, "disk") → "n disks". Keeps log lines tidy.
|
||||
func formatCount(n int, label string) string {
|
||||
if n == 1 {
|
||||
return fmt.Sprintf("%d %s", n, label)
|
||||
}
|
||||
return fmt.Sprintf("%d %ss", n, label)
|
||||
}
|
||||
Reference in New Issue
Block a user