kairos/internal/agent/hooks/hook.go
Ettore Di Giacinto bac4d73d9a
enhancements (#263)
* 🎨 Do not need to prefix '.' on queries

*  Add recovery to stateapi

*  Add cloudconfig SDK

*  Unify post-install/firstboot hooks

This also adds capabilities to add grub option at first boot rather than
after installation as for bundles.

* 🤖 Optimize tests to wait for state to change
2022-10-24 08:34:49 +02:00

32 lines
601 B
Go

package hook
import (
config "github.com/kairos-io/kairos/pkg/config"
)
type Interface interface {
Run(c config.Config) error
}
var All = []Interface{
&RunStage{}, // Shells out to stages defined from the container image
&GrubOptions{}, // Set custom GRUB options
&BundleOption{},
&Kcrypt{},
&Lifecycle{}, // Handles poweroff/reboot by config options
}
var FirstBoot = []Interface{
&BundlePostInstall{},
&GrubPostInstallOptions{},
}
func Run(c config.Config, hooks ...Interface) error {
for _, h := range hooks {
if err := h.Run(c); err != nil {
return err
}
}
return nil
}