Files
kairos-agent/internal/agent/notify.go
Ettore Di Giacinto b19a93e984 Merge pull request #55 from c3os-io/feature/cluster-provider
Abstract Cluster Provisioning with Cluster Plugins
2022-08-09 08:01:54 +02:00

24 lines
463 B
Go

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
}