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,33 @@
|
||||
package janitor
|
||||
|
||||
import (
|
||||
"context"
|
||||
"time"
|
||||
|
||||
"vetting/internal/logs"
|
||||
"vetting/internal/store"
|
||||
)
|
||||
|
||||
// StoreAdapter bridges the concrete orchestrator stores to the Janitor's
|
||||
// dependency interface. Kept in the janitor package so the orchestrator
|
||||
// wire-up stays a single-line: janitor.New(cfg, &janitor.StoreAdapter{...}).
|
||||
type StoreAdapter struct {
|
||||
Runs *store.Runs
|
||||
Artifacts *store.Artifacts
|
||||
Logs *logs.Hub
|
||||
}
|
||||
|
||||
func (a *StoreAdapter) CompletedOlderThan(ctx context.Context, cutoff time.Time) ([]int64, error) {
|
||||
return a.Runs.CompletedOlderThan(ctx, cutoff)
|
||||
}
|
||||
|
||||
func (a *StoreAdapter) DeleteArtifactsForRun(ctx context.Context, runID int64) ([]store.Artifact, error) {
|
||||
return a.Artifacts.DeleteForRun(ctx, runID)
|
||||
}
|
||||
|
||||
func (a *StoreAdapter) LogPathFor(runID int64) string {
|
||||
if a.Logs == nil {
|
||||
return ""
|
||||
}
|
||||
return a.Logs.PathFor(runID)
|
||||
}
|
||||
Reference in New Issue
Block a user