-
Notifications
You must be signed in to change notification settings - Fork 750
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Add Data Filter Comparator (#544)
* add data filter comparator * added api docs from 'make codgen' output, updated types.go * add data filter comparator * feat: support json body as an option [POC] (#542) * Idea POC for discussion * Make codegen with docs * JSONBody on AMQP, MQTT, and NATS gateways * Protobuf struct tags * Codegen docs * added api docs from 'make codgen' output, updated types.go * added tests for data filter comparator Co-authored-by: Antonio Macías Ojeda <[email protected]> Co-authored-by: Vaibhav <[email protected]>
- Loading branch information
1 parent
f0b1eda
commit 32eba6f
Showing
7 changed files
with
315 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Sensor | ||
metadata: | ||
name: webhook-with-data-filter-comparator-sensor | ||
labels: | ||
# sensor controller with instanceId "argo-events" will process this sensor | ||
sensors.argoproj.io/sensor-controller-instanceid: argo-events | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: sensor | ||
image: argoproj/sensor:v0.13.0-rc | ||
imagePullPolicy: Always | ||
serviceAccountName: argo-events-sa | ||
dependencies: | ||
- name: test-dep | ||
gatewayName: webhook-gateway | ||
eventName: example | ||
filters: | ||
name: data-filter | ||
data: | ||
- path: body.value | ||
type: number | ||
comparator: ">" | ||
value: | ||
- "50.0" | ||
subscription: | ||
http: | ||
port: 9300 | ||
triggers: | ||
- template: | ||
name: data-workflow | ||
k8s: | ||
group: argoproj.io | ||
version: v1alpha1 | ||
resource: workflows | ||
operation: create | ||
source: | ||
resource: | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Workflow | ||
metadata: | ||
generateName: data-workflow- | ||
spec: | ||
entrypoint: whalesay | ||
arguments: | ||
parameters: | ||
- name: message | ||
# value will get overridden by the event payload | ||
value: hello world | ||
templates: | ||
- name: whalesay | ||
inputs: | ||
parameters: | ||
- name: message | ||
container: | ||
image: docker/whalesay:latest | ||
command: [cowsay] | ||
args: ["{{inputs.parameters.message}}"] | ||
parameters: | ||
- src: | ||
dependencyName: test-dep | ||
dataKey: body.value | ||
dest: spec.arguments.parameters.0.value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Sensor | ||
metadata: | ||
name: webhook-with-data-filter-value-sensor | ||
labels: | ||
# sensor controller with instanceId "argo-events" will process this sensor | ||
sensors.argoproj.io/sensor-controller-instanceid: argo-events | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: sensor | ||
image: argoproj/sensor:v0.13.0-rc | ||
imagePullPolicy: Always | ||
serviceAccountName: argo-events-sa | ||
dependencies: | ||
- name: test-dep | ||
gatewayName: webhook-gateway | ||
eventName: example | ||
filters: | ||
name: data-filter | ||
data: | ||
- path: body.value | ||
type: number | ||
value: | ||
- "50.0" | ||
subscription: | ||
http: | ||
port: 9300 | ||
triggers: | ||
- template: | ||
name: data-workflow | ||
k8s: | ||
group: argoproj.io | ||
version: v1alpha1 | ||
resource: workflows | ||
operation: create | ||
source: | ||
resource: | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Workflow | ||
metadata: | ||
generateName: data-workflow- | ||
spec: | ||
entrypoint: whalesay | ||
arguments: | ||
parameters: | ||
- name: message | ||
# value will get overridden by the event payload | ||
value: hello world | ||
templates: | ||
- name: whalesay | ||
inputs: | ||
parameters: | ||
- name: message | ||
container: | ||
image: docker/whalesay:latest | ||
command: [cowsay] | ||
args: ["{{inputs.parameters.message}}"] | ||
parameters: | ||
- src: | ||
dependencyName: test-dep | ||
dest: spec.arguments.parameters.0.value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters