mirror of
https://github.com/kairos-io/kairos-sdk.git
synced 2025-09-12 21:33:05 +00:00
adding utils components to handle k0s
Signed-off-by: William Rizzo <william.rizzo@gmail.com>
This commit is contained in:
committed by
Mauro Morales
parent
a2d305dd6d
commit
474faf6370
@@ -106,6 +106,37 @@ func K3sEnvUnit(unit string) string {
|
||||
|
||||
return fmt.Sprintf("/etc/sysconfig/%s", unit)
|
||||
}
|
||||
func K0s() (Service, error) {
|
||||
if utils.IsOpenRCBased() {
|
||||
return openrc.NewService(
|
||||
openrc.WithName("k0scontroller"),
|
||||
)
|
||||
}
|
||||
|
||||
return systemd.NewService(
|
||||
systemd.WithName("k0scontroller"),
|
||||
)
|
||||
}
|
||||
|
||||
func K0sWorker() (Service, error) {
|
||||
if utils.IsOpenRCBased() {
|
||||
return openrc.NewService(
|
||||
openrc.WithName("k3sworker"),
|
||||
)
|
||||
}
|
||||
|
||||
return systemd.NewService(
|
||||
systemd.WithName("k0sworker"),
|
||||
)
|
||||
}
|
||||
|
||||
func K0sEnvUnit(unit string) string {
|
||||
if utils.IsOpenRCBased() {
|
||||
return fmt.Sprintf("/etc/k0s/%s.env", unit)
|
||||
}
|
||||
|
||||
return fmt.Sprintf("/etc/sysconfig/%s", unit)
|
||||
}
|
||||
|
||||
func UUID() string {
|
||||
if os.Getenv("UUID") != "" {
|
||||
|
Reference in New Issue
Block a user