Events: add node for formatting/filtering cloudevents (#1390)
This commit is contained in:
43 files changed
+1591
-320
No files matched your search
@@ -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
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in new issue
Block a user