Documentation
¶
Overview ¶
Package history logs image success/failure to disk.
Data logged includes image name and success/failure counts for imaging and first boot.
IMPORTANT When using in recovery, must add history.RebootHook to log.Preboot.
Index ¶
- Variables
- func Check(name string) (ok bool)
- func Load() (ok bool)
- func RebootHook(success bool)
- func RecordBootState(imgName string, success bool, severity uint, bTime time.Time, notes string)
- func Rollover(path string)
- func SetRoot(path string)
- func WriteArbitraryHistory(rec string, res ResultList)
- type ImageResult
- type ResultList
Constants ¶
This section is empty.
Variables ¶
View Source
var (
MaxFailuresPerImg uint = 5 //max allowed sum of ImagingFailures and BootFailures
)
Functions ¶
func RebootHook ¶
func RebootHook(success bool)
When added to log.Preboot, RebootHook updates the history file at the end of factory restore.
Updated entry is shuffled to front of list, so RecordBootState can determine which entry to update even if the disktag is missing.
func RecordBootState ¶
RecordBootState records boot status (success/failure, how badly failed).
If imgName is empty or otherwise doesn't appear valid, update stats for first entry.
func SetRoot ¶
func SetRoot(path string)
Sets where the history file can be found. Path is stored for use by other functions in the package.
func WriteArbitraryHistory ¶
func WriteArbitraryHistory(rec string, res ResultList)
Writes arbitrary records to history file, for use in integ tests.
Types ¶
type ImageResult ¶
type ImageResult struct { Image string //image name ImagingAttempts uint `json:",omitempty"` //currently only written, not used ImagingFailures uint `json:",omitempty"` BootAttempts uint `json:",omitempty"` //currently only written, not used BootFailures uint `json:",omitempty"` Notes []string `json:",omitempty"` //record timestamp+reason for failure }
type ResultList ¶
type ResultList []*ImageResult
Click to show internal directories.
Click to hide internal directories.