Events: add node for formatting/filtering cloudevents (#1390)

This commit is contained in:
Jim authored and GitHub committed 2021-07-25 17:40:54 -04:00
1 parent 1ebb8efab6
commit 11124794bf
43 files changed
+1591 -320

No files matched your search

+17 -1
View File
@@ -147,7 +147,23 @@ func (c *Command) Run(args []string) int {
return base.CommandUserError
}
if err := c.SetupEventing(c.Logger, c.StderrLock, base.WithEventerConfig(c.Config.Eventing)); err != nil {
var serverNames []string
if c.Config.Controller != nil {
if _, err := c.Config.Controller.InitNameIfEmpty(); err != nil {
c.UI.Error(err.Error())
return base.CommandUserError
}
serverNames = append(serverNames, c.Config.Controller.Name)
}
if c.Config.Worker != nil {
if _, err := c.Config.Worker.InitNameIfEmpty(); err != nil {
c.UI.Error(err.Error())
return base.CommandUserError
}
serverNames = append(serverNames, c.Config.Worker.Name)
}
if err := c.SetupEventing(c.Logger, c.StderrLock, strings.Join(serverNames, "/"), base.WithEventerConfig(c.Config.Eventing)); err != nil {
c.UI.Error(err.Error())
return base.CommandUserError
}
+1 -1
View File
@@ -29,7 +29,7 @@ func testServerCommand(t *testing.T, controllerKey string) *Command {
}
require.NoError(cmd.SetupLogging("trace", "", "", ""))
require.NoError(cmd.SetupEventing(cmd.Logger, cmd.StderrLock))
require.NoError(cmd.SetupEventing(cmd.Logger, cmd.StderrLock, "test-server-command"))
kmsHcl := fmt.Sprintf(rootKmsConfig, controllerKey)
parsedKmsConfig, err := config.Parse(kmsHcl)