mirror of
https://github.com/kairos-io/kairos-agent.git
synced 2025-04-28 11:36:48 +00:00
36 lines
655 B
Go
36 lines
655 B
Go
package hook
|
|
|
|
import (
|
|
config "github.com/kairos-io/kairos/pkg/config"
|
|
)
|
|
|
|
type Interface interface {
|
|
Run(c config.Config) error
|
|
}
|
|
|
|
var AfterInstall = []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 AfterReset = []Interface{
|
|
&Kcrypt{},
|
|
}
|
|
|
|
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
|
|
}
|