type HookState struct {
// Prestart is true if the hook has run Prestart successfully and does// not need to run again
PrestartDone bool// Data allows hooks to persist arbitrary state. Data map[string]string// Environment variables set by the hook that will continue to be set// even if PrestartDone=true.
Env map[string]string
}
type LocalState struct {
Hooks map[string]*HookState// DriverNetwork is the network information returned by the task// driver's Start method
DriverNetwork *drivers.DriverNetwork// TaskHandle is the handle used to reattach to the task during recovery TaskHandle *drivers.TaskHandle
}
LocalState is Task state which is persisted for use when restarting Nomad
agents.
Canonicalize ensures LocalState is in a consistent state by initializing
Hooks and ensuring no HookState's are nil. Useful for cleaning unmarshalled
state which may be in an unknown state.