Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Replace gatewayName with eventSourceName in Sensor dependencies #687

Merged
merged 13 commits into from
Jun 26, 2020
7 changes: 6 additions & 1 deletion api/openapi-spec/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -1807,19 +1807,24 @@
"required": [
"name",
"gatewayName",
"eventSourceName",
"eventName"
],
"properties": {
"eventName": {
"description": "EventName is the name of the event",
"type": "string"
},
"eventSourceName": {
"description": "EventSourceName is the name of EventSource that Sensor depends on",
"type": "string"
},
"filters": {
"description": "Filters and rules governing toleration of success and constraints on the context and data of an event",
"$ref": "#/definitions/io.argoproj.sensor.v1alpha1.EventDependencyFilter"
},
"gatewayName": {
"description": "GatewayName is the name of the gateway from whom the event is received",
"description": "GatewayName is the name of the gateway from whom the event is received DEPRECATED: Use EventSourceName instead.",
"type": "string"
},
"name": {
Expand Down
14 changes: 13 additions & 1 deletion api/sensor.html
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,19 @@ <h3 id="argoproj.io/v1alpha1.EventDependency">EventDependency
</em>
</td>
<td>
<p>GatewayName is the name of the gateway from whom the event is received</p>
<p>GatewayName is the name of the gateway from whom the event is received
DEPRECATED: Use EventSourceName instead.</p>
</td>
</tr>
<tr>
<td>
<code>eventSourceName</code></br>
<em>
string
</em>
</td>
<td>
<p>EventSourceName is the name of EventSource that Sensor depends on</p>
</td>
</tr>
<tr>
Expand Down
21 changes: 21 additions & 0 deletions api/sensor.md
Original file line number Diff line number Diff line change
Expand Up @@ -1638,6 +1638,27 @@ Name is a unique name of this dependency
<p>

GatewayName is the name of the gateway from whom the event is received
DEPRECATED: Use EventSourceName instead.

</p>

</td>

</tr>

<tr>

<td>

<code>eventSourceName</code></br> <em> string </em>

</td>

<td>

<p>

EventSourceName is the name of EventSource that Sensor depends on

</p>

Expand Down
6 changes: 3 additions & 3 deletions controllers/sensor/validate.go
Original file line number Diff line number Diff line change
Expand Up @@ -453,9 +453,9 @@ func validateDependencies(eventDependencies []v1alpha1.EventDependency) error {
if dep.Name == "" {
return errors.New("event dependency must define a name")
}

if dep.GatewayName == "" {
return errors.New("event dependency must define the gateway name")
// TODO: GatewayName will be deprecated
if dep.EventSourceName == "" && dep.GatewayName == "" {
return errors.New("event dependency must define the EventSource name")
}

if dep.EventName == "" {
Expand Down
2 changes: 1 addition & 1 deletion docs/demo/notebooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ In this demo, we are going to set up an image processing pipeline using 2 notebo
serviceAccountName: argo-events-sa
dependencies:
- name: test-dep
gatewayName: webhook-gateway
eventSourceName: webhook-event-source
eventName: example
subscription:
http:
Expand Down
2 changes: 1 addition & 1 deletion docs/triggers/argo-workflow.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ Argo workflow is K8s custom resource which help orchestrating parallel jobs on K
serviceAccountName: argo-events-sa
dependencies:
- name: test-dep
gatewayName: webhook-gateway
eventSourceName: webhook-event-source
eventName: example
subscription:
http:
Expand Down
2 changes: 1 addition & 1 deletion docs/triggers/build-your-own-trigger.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ Let's look at the following sensor,
serviceAccountName: argo-events-sa
dependencies:
- name: test-dep
gatewayName: webhook-gateway
eventSourceName: webhook-event-source
eventName: example
subscription:
http:
Expand Down
4 changes: 2 additions & 2 deletions docs/triggers/http-trigger.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ to invoke OpenFaas function.
serviceAccountName: argo-events-sa
dependencies:
- name: test-dep
gatewayName: redis-gateway
eventSourceName: redis-event-source
eventName: example
subscription:
http:
Expand Down Expand Up @@ -240,7 +240,7 @@ Similar to REST API calls, you can easily invoke Kubeless functions using HTTP t
serviceAccountName: argo-events-sa
dependencies:
- name: test-dep
gatewayName: nats-gateway
eventSourceName: nats-event-source
eventName: example
subscription:
http:
Expand Down
2 changes: 1 addition & 1 deletion docs/triggers/k8s-object-trigger.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ set up event-driven pipelines for existing workloads.
serviceAccountName: argo-events-sa
dependencies:
- name: test-dep
gatewayName: webhook-gateway
eventSourceName: webhook-event-source
eventName: example
subscription:
http:
Expand Down
2 changes: 1 addition & 1 deletion docs/triggers/kafka-trigger.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The Kafka trigger specification is available [here](https://github.com/argoproj/
serviceAccountName: argo-events-sa
dependencies:
- name: test-dep
gatewayName: minio-gateway
eventSourceName: minio-event-source
eventName: example
subscription:
http:
Expand Down
2 changes: 1 addition & 1 deletion docs/triggers/nats-trigger.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The NATS trigger specification is available [here](https://github.com/argoproj/a
serviceAccountName: argo-events-sa
dependencies:
- name: test-dep
gatewayName: minio-gateway
eventSourceName: minio-event-source
eventName: example
subscription:
http:
Expand Down
8 changes: 4 additions & 4 deletions docs/tutorials/02-parameterization.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ The structure of the event the Webhook sensor receives from the gateway looks li

{
"context": {
"type": "type_of_gateway",
"type": "type_of_eventsource",
"specVersion": "cloud_events_version",
"source": "name_of_the_gateway",
"source": "name_of_the_eventsource",
"eventID": "unique_event_id",
"time": "event_time",
"dataContentType": "type_of_data",
Expand Down Expand Up @@ -193,9 +193,9 @@ Consider the event the sensor received has format like,

{
"context": {
"type": "type_of_gateway",
"type": "type_of_eventsource",
"specVersion": "cloud_events_version",
"source": "name_of_the_gateway",
"source": "name_of_the_eventsource",
"eventID": "unique_event_id",
"time": "event_time",
"dataContentType": "type_of_data",
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/07-filters.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ payload structure as,

{
"context": {
"type": "type_of_gateway",
"type": "type_of_eventsource",
"specVersion": "cloud_events_version",
"source": "name_of_the_gateway",
"source": "name_of_the_eventsource",
"eventID": "unique_event_id",
"time": "event_time",
"dataContentType": "type_of_data",
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorials/09-events-over-nats.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ Up until now, you have seen the gateway dispatch events to sensor over HTTP. In
serviceAccountName: argo-events-sa
dependencies:
- name: test-dep
gatewayName: webhook-gateway
eventSourceName: webhook-event-source
eventName: example
subscription:
nats:
Expand Down Expand Up @@ -214,7 +214,7 @@ You can easily set up a gateway to send events over both HTTP and NATS,
serviceAccountName: argo-events-sa
dependencies:
- name: test-dep
gatewayName: webhook-gateway
eventSourceName: webhook-event-source
eventName: example
subscription:
http:
Expand Down
2 changes: 1 addition & 1 deletion examples/sensors/amqp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:
port: 9300
dependencies:
- name: test-dep
gatewayName: amqp
eventSourceName: amqp-event-source
eventName: example
triggers:
- template:
Expand Down
2 changes: 1 addition & 1 deletion examples/sensors/aws-lambda-trigger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ spec:
serviceAccountName: argo-events-sa
dependencies:
- name: test-dep
gatewayName: webhook
eventSourceName: webhook-event-source
eventName: example
subscription:
http:
Expand Down
2 changes: 1 addition & 1 deletion examples/sensors/aws-sns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:
port: 9300
dependencies:
- name: test-dep
gatewayName: aws-sns
eventSourceName: aws-sns-event-source
eventName: example
triggers:
- template:
Expand Down
2 changes: 1 addition & 1 deletion examples/sensors/aws-sqs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:
port: 9300
dependencies:
- name: test-dep
gatewayName: aws-sqs
eventSourceName: aws-sqs-event-source
eventName: example
triggers:
- template:
Expand Down
2 changes: 1 addition & 1 deletion examples/sensors/azure-events-hub.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:
port: 9300
dependencies:
- name: test-dep
gatewayName: azure-events-hub
eventSourceName: azure-events-hub-event-source
eventName: example
triggers:
- template:
Expand Down
2 changes: 1 addition & 1 deletion examples/sensors/calendar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ spec:
serviceAccountName: argo-events-sa
dependencies:
- name: test-dep
gatewayName: calendar
eventSourceName: calendar-event-source
eventName: example-with-interval
subscription:
http:
Expand Down
2 changes: 1 addition & 1 deletion examples/sensors/complete-trigger-parameterization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ spec:
serviceAccountName: argo-events-sa
dependencies:
- name: test-dep
gatewayName: webhook
eventSourceName: webhook-event-source
eventName: example
subscription:
http:
Expand Down
2 changes: 1 addition & 1 deletion examples/sensors/context-filter-webhook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ spec:
serviceAccountName: argo-events-sa
dependencies:
- name: test-dep
gatewayName: webhook
eventSourceName: webhook-event-source
eventName: example
# The filter is applied on the context of the event.
# The trigger will be executed only of the event passes the filter
Expand Down
2 changes: 1 addition & 1 deletion examples/sensors/custom-trigger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ spec:
serviceAccountName: argo-events-sa
dependencies:
- name: test-dep
gatewayName: webhook
eventSourceName: webhook-event-source
eventName: example
subscription:
http:
Expand Down
2 changes: 1 addition & 1 deletion examples/sensors/data-filter-comparator-webhook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ spec:
serviceAccountName: argo-events-sa
dependencies:
- name: test-dep
gatewayName: webhook
eventSourceName: webhook-event-source
eventName: example
filters:
name: data-filter
Expand Down
2 changes: 1 addition & 1 deletion examples/sensors/data-filter-value-webhook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ spec:
serviceAccountName: argo-events-sa
dependencies:
- name: test-dep
gatewayName: webhook
eventSourceName: webhook-event-source
eventName: example
filters:
name: data-filter
Expand Down
2 changes: 1 addition & 1 deletion examples/sensors/data-filter-webhook.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ spec:
serviceAccountName: argo-events-sa
dependencies:
- name: test-dep
gatewayName: webhook
eventSourceName: webhook-event-source
eventName: example
filters:
name: data-filter
Expand Down
4 changes: 2 additions & 2 deletions examples/sensors/dependencies-circuit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ spec:
# defines list of all events sensor will accept
dependencies:
- name: test-dep
gatewayName: webhook
eventSourceName: webhook-event-source
eventName: example
- name: test-dep-foo
gatewayName: webhook
eventSourceName: webhook-event-source
eventName: example-foo

# group event dependencies
Expand Down
2 changes: 1 addition & 1 deletion examples/sensors/emitter.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:
port: 9300
dependencies:
- name: test-dep
gatewayName: emitter
eventSourceName: emitter-event-source
eventName: example
triggers:
- template:
Expand Down
2 changes: 1 addition & 1 deletion examples/sensors/file.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ spec:
serviceAccountName: argo-events-sa
dependencies:
- name: test-dep
gatewayName: file
eventSourceName: file-event-source
eventName: example
subscription:
http:
Expand Down
2 changes: 1 addition & 1 deletion examples/sensors/gcp-pubsub.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:
port: 9300
dependencies:
- name: test-dep
gatewayName: gcp-pubsub
eventSourceName: gcp-pubsub-event-source
eventName: example
triggers:
- template:
Expand Down
2 changes: 1 addition & 1 deletion examples/sensors/github.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ spec:
serviceAccountName: argo-events-sa
dependencies:
- name: test-dep
gatewayName: github
eventSourceName: github-event-source
eventName: example
subscription:
http:
Expand Down
2 changes: 1 addition & 1 deletion examples/sensors/gitlab.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ spec:
port: 9300
dependencies:
- name: test-dep
gatewayName: gitlab
eventSourceName: gitlab-event-source
eventName: example
triggers:
- template:
Expand Down
2 changes: 1 addition & 1 deletion examples/sensors/hdfs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ spec:
serviceAccountName: argo-events-sa
dependencies:
- name: test-dep
gatewayName: hdfs
eventSourceName: hdfs-event-source
eventName: example
subscription:
http:
Expand Down
2 changes: 1 addition & 1 deletion examples/sensors/http-trigger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ spec:
serviceAccountName: argo-events-sa
dependencies:
- name: test-dep
gatewayName: minio
eventSourceName: minio-event-source
eventName: example
subscription:
http:
Expand Down
Loading