Skip to content

Commit 55be123

Browse files
committed
Improve templating for event-sources
1 parent 12af7d5 commit 55be123

File tree

2 files changed

+14
-12
lines changed

2 files changed

+14
-12
lines changed
Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,18 @@
11
{{- if index .Values "argo-events" "enabled" }}
22
{{- range $eventSource := $.Values.eventSources }}
3-
{{- if eq $eventSource.name "webhook" }}
43
---
54
apiVersion: argoproj.io/v1alpha1
65
kind: EventSource
76
metadata:
8-
name: webhook
7+
name: {{ $eventSource.name }}
98
spec:
109
service:
1110
ports:
1211
- port: {{$eventSource.port }}
1312
targetPort: {{$eventSource.port }}
13+
{{- if $eventSource.webhook }}
1414
webhook:
15-
# event-source can run multiple HTTP servers. Simply define a unique port to start a new HTTP server
16-
example:
17-
# port to run HTTP server on
18-
port: "{{$eventSource.port }}"
19-
# endpoint to listen to
20-
endpoint: /{{ $eventSource.endpoint }}
21-
# HTTP request method to allow. In this case, only POST requests are accepted
22-
method: POST
23-
{{- end }}
15+
{{- $eventSource.webhook | toYaml | nindent 6 }}
16+
{{- end }}
2417
{{- end }}
2518
{{- end }}

charts/events/values.yaml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,4 +25,13 @@ eventBuses:
2525
eventSources:
2626
- name: webhook
2727
port: 12000
28-
endpoint: example
28+
webhook:
29+
# event-source can run multiple HTTP servers. Simply define a unique port to start a new HTTP server
30+
example:
31+
# port to run HTTP server on
32+
port: "12000"
33+
# endpoint to listen to
34+
endpoint: /example
35+
# HTTP request method to allow. In this case, only POST requests are accepted
36+
method: POST
37+

0 commit comments

Comments
 (0)