File tree Expand file tree Collapse file tree 3 files changed +59
-2
lines changed Expand file tree Collapse file tree 3 files changed +59
-2
lines changed Original file line number Diff line number Diff line change 1
1
{{- $eventBusName := default "codefresh-eventbus" .Values.global.runtime.eventBus.name }}
2
2
{{- $eventBusSpec := .Values.global.runtime.eventBus }}
3
+ {{- $eventBusType := .Values.global.runtime.eventBus.type }}
3
4
{{/* Remove name from eventbus spec */}}
4
5
{{- if hasKey $eventBusSpec "name" }}
5
6
{{- $eventBusSpec = unset $eventBusSpec "name" }}
8
9
{{- if hasKey $eventBusSpec "pdb" }}
9
10
{{- $eventBusSpec = unset $eventBusSpec "pdb" }}
10
11
{{- end }}
12
+ {{/* Remove annotations from eventbus spec */}}
11
13
{{- if hasKey $eventBusSpec "annotations" }}
12
14
{{- $eventBusSpec = unset $eventBusSpec "annotations" }}
13
15
{{- end }}
14
16
15
- {{- $_ := set $eventBusSpec.nats.native "nodeSelector" ($eventBusSpec.nats.native.nodeSelector | default .Values.global.nodeSelector) }}
16
- {{- $_ := set $eventBusSpec.nats.native "tolerations" ($eventBusSpec.nats.native.tolerations | default .Values.global.tolerations) }}
17
+ {{- if eq $eventBusType "nats" }}
18
+ {{- $eventBusSpec = unset $eventBusSpec "jetstream" }}
19
+ {{- $_ := set $eventBusSpec.nats.native "nodeSelector" ($eventBusSpec.nats.native.nodeSelector | default .Values.global.nodeSelector) }}
20
+ {{- $_ := set $eventBusSpec.nats.native "tolerations" ($eventBusSpec.nats.native.tolerations | default .Values.global.tolerations) }}
21
+ {{- end }}
22
+
23
+ {{- if eq $eventBusType "jetstream" }}
24
+ {{- $eventBusSpec = unset $eventBusSpec "nats" }}
25
+ {{- $_ := set $eventBusSpec.jetstream "nodeSelector" ($eventBusSpec.jetstream.nodeSelector | default .Values.global.nodeSelector) }}
26
+ {{- $_ := set $eventBusSpec.jetstream "tolerations" ($eventBusSpec.jetstream.tolerations | default .Values.global.tolerations) }}
27
+ {{- end }}
17
28
18
29
apiVersion : argoproj.io/v1alpha1
19
30
kind : EventBus
Original file line number Diff line number Diff line change
1
+ # yaml-language-server: $schema=https://raw.githubusercontent.com/helm-unittest/helm-unittest/main/schema/helm-testsuite.json
2
+ suite : eventbus tests
3
+ templates :
4
+ - eventbus/codefresh-eventbus.yaml
5
+ tests :
6
+ - it : Should create an EventBus with the correct type (nats)
7
+ template : eventbus/codefresh-eventbus.yaml
8
+ values :
9
+ - ./values/mandatory-values.yaml
10
+ set :
11
+ global.runtime.eventBus.type : nats
12
+ asserts :
13
+ - exists :
14
+ path : spec.nats
15
+ - notExists :
16
+ path : spec.jetstream
17
+
18
+ - it : Should create an EventBus with the correct type (jetstream)
19
+ template : eventbus/codefresh-eventbus.yaml
20
+ values :
21
+ - ./values/mandatory-values.yaml
22
+ set :
23
+ global.runtime.eventBus.type : jetstream
24
+ asserts :
25
+ - exists :
26
+ path : spec.jetstream
27
+ - notExists :
28
+ path : spec.nats
Original file line number Diff line number Diff line change @@ -93,6 +93,7 @@ global:
93
93
enabled : true
94
94
# -- Minimum number of available eventbus pods. For eventbus to stay functional the majority of its replicas should always be available.
95
95
minAvailable : 2
96
+ type : nats # -- Eventbus type. Can be nats or jetstream.
96
97
nats :
97
98
native :
98
99
nodeSelector : {}
@@ -111,6 +112,23 @@ global:
111
112
cpu : 200m
112
113
memory : 1Gi
113
114
ephemeral-storage : 2Gi
115
+ jetstream :
116
+ version : latest
117
+ nodeSelector : {}
118
+ tolerations : []
119
+ affinity : {}
120
+ replicas : 3
121
+ maxPayload : " 4MB"
122
+ containerTemplate :
123
+ resources :
124
+ limits :
125
+ cpu : 500m
126
+ memory : 4Gi
127
+ ephemeral-storage : 2Gi
128
+ requests :
129
+ cpu : 200m
130
+ memory : 1Gi
131
+ ephemeral-storage : 2Gi
114
132
115
133
# -- Configuration for external ArgoCD
116
134
# Should be used when `argo-cd.enabled` is set to false
You can’t perform that action at this time.
0 commit comments