kairos/internal/agent/hooks/hook.go
Dimitris Karakasilis 0f9270ac07
Change module path according to Go docs (#1220)
https://go.dev/doc/modules/major-version

This way we can bump the kairos dependency on the provider-kairos repo

which otherwise produced the error:

```
~/workspace/kairos/provider-kairos (main)*$ go get -u github.com/kairos-io/kairos@v2.0.0-alpha3
go: github.com/kairos-io/kairos@v2.0.0-alpha3: invalid version: module contains a go.mod file, so module path must match major version ("github.com/kairos-io/kairos/v2")
```

Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
Co-authored-by: Itxaka <itxaka.garcia@spectrocloud.com>
2023-03-30 14:18:53 +03:00

35 lines
663 B
Go

package hook
import (
config "github.com/kairos-io/kairos/v2/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{},
&CustomMounts{},
&Kcrypt{},
&Lifecycle{}, // Handles poweroff/reboot by config options
}
var AfterReset = []Interface{}
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
}