mirror of
https://github.com/kairos-io/kairos-agent.git
synced 2025-09-18 07:50:38 +00:00
Merge pull request #55 from c3os-io/feature/cluster-provider
Abstract Cluster Provisioning with Cluster Plugins
This commit is contained in:
committed by
Itxaka
parent
7ac3c30747
commit
b19a93e984
23
internal/agent/notify.go
Normal file
23
internal/agent/notify.go
Normal file
@@ -0,0 +1,23 @@
|
||||
package agent
|
||||
|
||||
import (
|
||||
"github.com/c3os-io/c3os/internal/bus"
|
||||
"github.com/c3os-io/c3os/pkg/config"
|
||||
events "github.com/c3os-io/c3os/sdk/bus"
|
||||
"github.com/mudler/go-pluggable"
|
||||
)
|
||||
|
||||
func Notify(event string, dirs []string) error {
|
||||
bus.Manager.Initialize()
|
||||
|
||||
c, err := config.Scan(config.Directories(dirs...))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
_, err = bus.Manager.Publish(pluggable.EventType(event), events.EventPayload{
|
||||
Config: c.String(),
|
||||
})
|
||||
|
||||
return err
|
||||
}
|
Reference in New Issue
Block a user