File tree Expand file tree Collapse file tree 7 files changed +20
-8
lines changed
charts/gitops-runtime/templates
_components/event-reporters Expand file tree Collapse file tree 7 files changed +20
-8
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ metadata:
7
7
{{- include "event-reporters.rollout-reporter.labels" . | nindent 4}}
8
8
spec :
9
9
replicas : {{ .Values.rollout.eventSource.replicas }}
10
- eventBusName : {{ default "codefresh-eventbus" .Values.global.runtime.eventBus.name }}
10
+ eventBusName : {{ include "codefresh-gitops-runtime. eventbus.name " .Values.global.runtime.eventBus }}
11
11
resource :
12
12
analysisruns :
13
13
eventTypes :
Original file line number Diff line number Diff line change 17
17
- name : analysisruns
18
18
eventSourceName : rollout-reporter
19
19
eventName : analysisruns
20
- eventBusName : {{ default "codefresh-eventbus" .Values.global.runtime.eventBus.name }}
20
+ eventBusName : {{ include "codefresh-gitops-runtime. eventbus.name " .Values.global.runtime.eventBus }}
21
21
template :
22
22
serviceAccountName : {{ include "event-reporters.rollout-reporter.serviceAccountName" .}}
23
23
container :
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ metadata:
7
7
{{- include "event-reporters.workflow-reporter.labels" . | nindent 4 }}
8
8
spec :
9
9
replicas : {{ .Values.workflow.eventSource.replicas }}
10
- eventBusName : {{ default "codefresh-eventbus" .Values.global.runtime.eventBus.name }}
10
+ eventBusName : {{ include "codefresh-gitops-runtime. eventbus.name " .Values.global.runtime.eventBus }}
11
11
resource :
12
12
workflows :
13
13
eventTypes :
Original file line number Diff line number Diff line change 11
11
- eventName : workflows
12
12
eventSourceName : workflow-reporter
13
13
name : workflows
14
- eventBusName : {{ default "codefresh-eventbus" .Values.global.runtime.eventBus.name }}
14
+ eventBusName : {{ include "codefresh-gitops-runtime. eventbus.name " .Values.global.runtime.eventBus }}
15
15
template :
16
16
serviceAccountName : {{ include "event-reporters.workflow-reporter.serviceAccountName" .}}
17
17
container :
Original file line number Diff line number Diff line change @@ -522,3 +522,17 @@ HTTPS_PROXY: {{ .Values.global.httpsProxy }}
522
522
NO_PROXY: { { .Values.global.noProxy } }
523
523
{ {- end } }
524
524
{ {- end -} }
525
+
526
+ { {- define " codefresh-gitops-runtime.eventbus.name" } }
527
+ { {- $eventBusName := " " } }
528
+ { {- $eventBusType := .type } }
529
+ { {- if eq $eventBusType " nats" } }
530
+ { {- $eventBusName = default " codefresh-eventbus" .name } }
531
+ { {- else if eq $eventBusType " jetstream" } }
532
+ { {- $eventBusName = default " codefresh-eventbus-jetstream" .name } }
533
+ { {- else } }
534
+ { {- fail (printf " ERROR: EventBus type %s is inavlid, must be nats|jetstream" $eventBusType ) } }
535
+ { {- end } }
536
+
537
+ { {- printf " %s" $eventBusName } }
538
+ { {- end } }
Original file line number Diff line number Diff line change 1
- {{- $eventBusName := . Values.global.runtime.eventBus.name }}
1
+ {{- $eventBusName := (include "codefresh-gitops-runtime.eventbus.name" . Values.global.runtime.eventBus) }}
2
2
{{- $eventBusSpec := .Values.global.runtime.eventBus }}
3
3
{{- $eventBusType := .Values.global.runtime.eventBus.type }}
4
4
{{/* Remove name from eventbus spec */}}
16
16
17
17
{{- if eq $eventBusType "nats" }}
18
18
{{- $eventBusSpec = unset $eventBusSpec "jetstream" }}
19
- {{- $eventBusName = default "codefresh-eventbus" $eventBusName }}
20
19
{{- $_ := set $eventBusSpec.nats.native "nodeSelector" ($eventBusSpec.nats.native.nodeSelector | default .Values.global.nodeSelector) }}
21
20
{{- $_ := set $eventBusSpec.nats.native "tolerations" ($eventBusSpec.nats.native.tolerations | default .Values.global.tolerations) }}
22
21
{{- end }}
23
22
24
23
{{- if eq $eventBusType "jetstream" }}
25
24
{{- $eventBusSpec = unset $eventBusSpec "nats" }}
26
- {{- $eventBusName = default "codefresh-eventbus-jetstream" $eventBusName }}
27
25
{{- $_ := set $eventBusSpec.jetstream "nodeSelector" ($eventBusSpec.jetstream.nodeSelector | default .Values.global.nodeSelector) }}
28
26
{{- $_ := set $eventBusSpec.jetstream "tolerations" ($eventBusSpec.jetstream.tolerations | default .Values.global.tolerations) }}
29
27
{{- end }}
Original file line number Diff line number Diff line change 1
- {{- $eventBusName := default "codefresh-eventbus" .Values.global.runtime.eventBus.name }}
1
+ {{- $eventBusName := (include "codefresh-gitops-runtime. eventbus.name " .Values.global.runtime.eventBus) }}
2
2
{{- if .Values.global.runtime.eventBus.pdb.enabled }}
3
3
apiVersion : policy/v1
4
4
kind : PodDisruptionBudget
You can’t perform that action at this time.
0 commit comments