mirror of
https://github.com/kairos-io/provider-k3s.git
synced 2025-08-30 20:07:17 +00:00
* 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>
31 lines
629 B
Go
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)
|
|
}
|
|
}
|