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

31 lines
689 B
Go
Raw Normal View History

package hook
import (
"fmt"
v1 "github.com/kairos-io/kairos-agent/v2/pkg/types/v1"
2023-07-10 12:39:48 +00:00
config "github.com/kairos-io/kairos-agent/v2/pkg/config"
"github.com/kairos-io/kairos-sdk/system"
)
type GrubOptions struct{}
func (b GrubOptions) Run(c config.Config, _ v1.Spec) error {
c.Logger.Debugf("Setting grub options: %s", c.Install.GrubOptions)
err := system.Apply(system.SetGRUBOptions(c.Install.GrubOptions))
if err != nil {
fmt.Println(err)
}
return nil
}
type GrubPostInstallOptions struct{}
func (b GrubPostInstallOptions) Run(c config.Config, _ v1.Spec) error {
err := system.Apply(system.SetGRUBOptions(c.GrubOptions))
if err != nil {
fmt.Println(err)
}
return nil
}