provider-k3s/main.go
Nianyu Shen 4fcff11e7e
PE-5115 add cluster reset event (#95)
* add cluster reset event

Signed-off-by: Nianyu Shen <xiaoyu9964@gmail.com>

* bump go to 1.23

Signed-off-by: Nianyu Shen <xiaoyu9964@gmail.com>

* fix uninstall script name

Signed-off-by: Nianyu Shen <xiaoyu9964@gmail.com>

---------

Signed-off-by: Nianyu Shen <xiaoyu9964@gmail.com>
2024-09-29 18:28:26 -07:00

31 lines
629 B
Go

package main
import (
"os"
"github.com/kairos-io/kairos-sdk/clusterplugin"
"github.com/mudler/go-pluggable"
"github.com/sirupsen/logrus"
"github.com/kairos-io/provider-k3s/pkg/provider"
)
func main() {
f, err := os.OpenFile("/var/log/provider-k3s.log", os.O_CREATE|os.O_APPEND|os.O_WRONLY, 0644)
if err != nil {
panic(err)
}
logrus.SetOutput(f)
plugin := clusterplugin.ClusterPlugin{
Provider: provider.ClusterProvider,
}
if err := plugin.Run(pluggable.FactoryPlugin{
EventType: clusterplugin.EventClusterReset,
PluginHandler: provider.HandleClusterReset,
}); err != nil {
logrus.Fatal(err)
}
}