This is an automated email from the ASF dual-hosted git repository.
pcongiusti pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-k.git
commit 6f6432c13ce09cd34ff460c6bf02f2a24b903fed
Author: Adriano Machado <unknown>
AuthorDate: Mon May 30 12:04:33 2022 -0400
YAML DSL support for wireTap
---
pkg/util/source/inspector_yaml.go | 2 +-
pkg/util/source/inspector_yaml_test.go | 18 ++++++++++++++++++
2 files changed, 19 insertions(+), 1 deletion(-)
diff --git a/pkg/util/source/inspector_yaml.go
b/pkg/util/source/inspector_yaml.go
index 379bd100b..e0f618096 100644
--- a/pkg/util/source/inspector_yaml.go
+++ b/pkg/util/source/inspector_yaml.go
@@ -161,7 +161,7 @@ func (i YAMLInspector) parseStep(key string, content
interface{}, meta *Metadata
switch key {
case "from":
meta.FromURIs = append(meta.FromURIs, maybeURI)
- case "to", "to-d", "toD":
+ case "to", "to-d", "toD", "wireTap":
meta.ToURIs = append(meta.ToURIs, maybeURI)
}
}
diff --git a/pkg/util/source/inspector_yaml_test.go
b/pkg/util/source/inspector_yaml_test.go
index 88d77d5ba..3ba4da8a5 100644
--- a/pkg/util/source/inspector_yaml_test.go
+++ b/pkg/util/source/inspector_yaml_test.go
@@ -83,6 +83,16 @@ const YAMLInDepthChannel = `
uri: knative:endpoint/service
`
+const YAMLWiretapEIP = `
+- from:
+ uri: knative:channel/mychannel
+ parameters:
+ period: "1000"
+ steps:
+ - wireTap:
+ uri: knative:channel/mychannel
+`
+
func TestYAMLDependencies(t *testing.T) {
tests := []struct {
name string
@@ -125,6 +135,14 @@ func TestYAMLDependencies(t *testing.T) {
`mvn:org.apache.camel.k:camel-k-knative-consumer`,
},
},
+ {
+ name: "wireTap",
+ source: YAMLWiretapEIP,
+ dependencies: []string{
+
`mvn:org.apache.camel.k:camel-k-knative-producer`,
+
`mvn:org.apache.camel.k:camel-k-knative-consumer`,
+ },
+ },
}
for i := range tests {
test := tests[i]