mirror of
https://github.com/kairos-io/kairos-agent.git
synced 2025-09-07 03:50:22 +00:00
Split off cli into separate binaries (#37)
* 🎨 Split off cli into separate binaries This commit splits off the cli into 3 binaries: - agent - cli - provider The provider now is a separate component that can be tested by itself and have its own lifecycle. This paves the way to a ligher c3os variant, HA support and other features that can be provided on runtime. This is working, but still there are low hanging fruit to care about. Fixes #14 * 🤖 Add provider bin to releases * ⚙️ Handle signals * ⚙️ Reduce buildsize footprint * 🎨 Scan for providers also in /system/providers * 🤖 Run goreleaser * 🎨 Refactoring
This commit is contained in:
26
cmd/provider/main.go
Normal file
26
cmd/provider/main.go
Normal file
@@ -0,0 +1,26 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"os"
|
||||
|
||||
"github.com/c3os-io/c3os/internal/provider"
|
||||
|
||||
"github.com/c3os-io/c3os/pkg/bus"
|
||||
"github.com/mudler/go-pluggable"
|
||||
)
|
||||
|
||||
func main() {
|
||||
factory := pluggable.NewPluginFactory()
|
||||
|
||||
// Input: bus.EventInstallPayload
|
||||
// Expected output: map[string]string{}
|
||||
factory.Add(bus.EventInstall, provider.Install)
|
||||
|
||||
factory.Add(bus.EventBootstrap, provider.Bootstrap)
|
||||
|
||||
// Input: config
|
||||
// Expected output: string
|
||||
factory.Add(bus.EventChallenge, provider.Challenge)
|
||||
|
||||
factory.Run(pluggable.EventType(os.Args[1]), os.Args[2], os.Stdout)
|
||||
}
|
Reference in New Issue
Block a user