mirror of
https://github.com/kairos-io/provider-kairos.git
synced 2025-08-27 03:19:10 +00:00
to let the kairos-agent handle upgrades from now on. It used to be that provider-kairos returned releases from the provider-kairos repository but it's no longer the case. Everything is release in the kairos-io/kairos repository and the new versioneer library of the kairos-sdk (which is used in the kairos-agent) is capabable of handling both "standard" and "core" images. Part of: https://github.com/kairos-io/kairos/issues/1999 Signed-off-by: Dimitris Karakasilis <dimitris@karakasilis.me>
32 lines
660 B
Go
32 lines
660 B
Go
package provider
|
|
|
|
import (
|
|
"os"
|
|
|
|
"github.com/kairos-io/kairos-sdk/bus"
|
|
|
|
"github.com/mudler/go-pluggable"
|
|
)
|
|
|
|
func Start() error {
|
|
factory := pluggable.NewPluginFactory()
|
|
|
|
// Input: bus.EventInstallPayload
|
|
// Expected output: map[string]string{}
|
|
factory.Add(bus.EventInstall, Install)
|
|
|
|
factory.Add(bus.EventBootstrap, Bootstrap)
|
|
|
|
// Input: config
|
|
// Expected output: string
|
|
factory.Add(bus.EventChallenge, Challenge)
|
|
|
|
factory.Add(bus.EventRecovery, Recovery)
|
|
|
|
factory.Add(bus.EventRecoveryStop, RecoveryStop)
|
|
|
|
factory.Add(bus.EventInteractiveInstall, InteractiveInstall)
|
|
|
|
return factory.Run(pluggable.EventType(os.Args[1]), os.Stdin, os.Stdout)
|
|
}
|