kairos-agent/internal/agent/hooks/lifecycle.go

20 lines
296 B
Go
Raw Normal View History

package hook
import (
2023-03-18 09:27:18 +00:00
"github.com/kairos-io/kairos-sdk/utils"
2023-07-10 12:39:48 +00:00
"github.com/kairos-io/kairos-agent/v2/pkg/config"
)
type Lifecycle struct{}
func (s Lifecycle) Run(c config.Config) error {
if c.Install.Reboot {
utils.Reboot()
}
if c.Install.Poweroff {
utils.PowerOFF()
}
return nil
}