-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathcodefresh-eventbus.yaml
More file actions
39 lines (36 loc) · 1.68 KB
/
codefresh-eventbus.yaml
File metadata and controls
39 lines (36 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{{- $eventBusName := (include "codefresh-gitops-runtime.eventbus.name" .Values.global.runtime.eventBus) }}
{{- $eventBusSpec := .Values.global.runtime.eventBus }}
{{- $eventBusType := .Values.global.runtime.eventBus.type }}
{{/* Remove name from eventbus spec */}}
{{- if hasKey $eventBusSpec "name" }}
{{- $eventBusSpec = unset $eventBusSpec "name" }}
{{- end }}
{{/* Remove pdb from eventbus spec */}}
{{- if hasKey $eventBusSpec "pdb" }}
{{- $eventBusSpec = unset $eventBusSpec "pdb" }}
{{- end }}
{{/* Remove annotations from eventbus spec */}}
{{- if hasKey $eventBusSpec "annotations" }}
{{- $eventBusSpec = unset $eventBusSpec "annotations" }}
{{- end }}
{{- if eq $eventBusType "nats" }}
{{- $eventBusSpec = unset $eventBusSpec "jetstream" }}
{{- $_ := set $eventBusSpec.nats.native "nodeSelector" ($eventBusSpec.nats.native.nodeSelector | default .Values.global.nodeSelector) }}
{{- $_ := set $eventBusSpec.nats.native "tolerations" ($eventBusSpec.nats.native.tolerations | default .Values.global.tolerations) }}
{{- end }}
{{- if eq $eventBusType "jetstream" }}
{{- $eventBusSpec = unset $eventBusSpec "nats" }}
{{- $_ := set $eventBusSpec.jetstream "nodeSelector" ($eventBusSpec.jetstream.nodeSelector | default .Values.global.nodeSelector) }}
{{- $_ := set $eventBusSpec.jetstream "tolerations" ($eventBusSpec.jetstream.tolerations | default .Values.global.tolerations) }}
{{- end }}
apiVersion: argoproj.io/v1alpha1
kind: EventBus
metadata:
name: {{ $eventBusName }}
annotations:
{{- .Values.global.runtime.eventBus.annotations | toYaml | nindent 4}}
labels:
app.kubernetes.io/part-of: argo-events
codefresh.io/internal: "true"
spec:
{{- $eventBusSpec | toYaml | nindent 2}}