metis/pkg/facts/types.go

46 lines
2.1 KiB
Go

package facts
// USBBindTarget captures a bind mount and whether it looked healthy.
type USBBindTarget struct {
Path string `json:"path,omitempty"`
Healthy bool `json:"healthy,omitempty"`
}
// USBScratch captures the desired scratch-disk configuration plus health.
type USBScratch struct {
Mountpoint string `json:"mountpoint,omitempty"`
UUID string `json:"uuid,omitempty"`
Label string `json:"label,omitempty"`
FS string `json:"fs,omitempty"`
MountHealthy bool `json:"mount_healthy,omitempty"`
UUIDHealthy bool `json:"uuid_healthy,omitempty"`
LabelHealthy bool `json:"label_healthy,omitempty"`
BindTargets []USBBindTarget `json:"bind_targets,omitempty"`
BindHealthy bool `json:"bind_healthy,omitempty"`
}
// ClassFacts captures driftable state collected by metis-sentinel.
type ClassFacts struct {
ClassName string `json:"class_name"`
Kernel string `json:"kernel,omitempty"`
K3sVersion string `json:"k3s_version,omitempty"`
Containerd string `json:"containerd,omitempty"`
Packages map[string]string `json:"packages,omitempty"` // name -> version
DropIns map[string]string `json:"dropins,omitempty"` // path -> content
Sysctl map[string]string `json:"sysctl,omitempty"` // key -> value
CGroupConfig map[string]string `json:"cgroup_config,omitempty"` // key -> value
USBMountHealth map[string]int `json:"usb_mount_health,omitempty"`
USBUUIDHealth map[string]int `json:"usb_uuid_health,omitempty"`
USBLabelHealth map[string]int `json:"usb_label_health,omitempty"`
USBBindHealth map[string]int `json:"usb_bind_health,omitempty"`
Notes string `json:"notes,omitempty"`
}
// NodeFacts captures per-node data (e.g., disk UUIDs) to verify drift.
type NodeFacts struct {
Hostname string `json:"hostname"`
Disks map[string]string `json:"disks,omitempty"` // mount -> UUID
USBScratch *USBScratch `json:"usb_scratch,omitempty"`
Notes string `json:"notes,omitempty"`
}