Skip to content

Commit 8f63c73

Browse files
committed
fix(eventbus): set default event bus name based on type
Update the event bus name assignment to use a default value based on the event bus type. This change ensures that the event bus name is correctly set for both NATS and Jetstream configurations, improving the clarity and consistency of the event bus setup.
1 parent f840a5a commit 8f63c73

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

charts/gitops-runtime/templates/eventbus/codefresh-eventbus.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- $eventBusName := default "codefresh-eventbus" .Values.global.runtime.eventBus.name }}
1+
{{- $eventBusName := .Values.global.runtime.eventBus.name }}
22
{{- $eventBusSpec := .Values.global.runtime.eventBus }}
33
{{- $eventBusType := .Values.global.runtime.eventBus.type }}
44
{{/* Remove name from eventbus spec */}}
@@ -16,12 +16,14 @@
1616

1717
{{- if eq $eventBusType "nats" }}
1818
{{- $eventBusSpec = unset $eventBusSpec "jetstream" }}
19+
{{- $eventBusName = default "codefresh-eventbus" $eventBusName }}
1920
{{- $_ := set $eventBusSpec.nats.native "nodeSelector" ($eventBusSpec.nats.native.nodeSelector | default .Values.global.nodeSelector) }}
2021
{{- $_ := set $eventBusSpec.nats.native "tolerations" ($eventBusSpec.nats.native.tolerations | default .Values.global.tolerations) }}
2122
{{- end }}
2223

2324
{{- if eq $eventBusType "jetstream" }}
2425
{{- $eventBusSpec = unset $eventBusSpec "nats" }}
26+
{{- $eventBusName = default "codefresh-eventbus-jetstream" $eventBusName }}
2527
{{- $_ := set $eventBusSpec.jetstream "nodeSelector" ($eventBusSpec.jetstream.nodeSelector | default .Values.global.nodeSelector) }}
2628
{{- $_ := set $eventBusSpec.jetstream "tolerations" ($eventBusSpec.jetstream.tolerations | default .Values.global.tolerations) }}
2729
{{- end }}

charts/gitops-runtime/values.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ global:
8181
# -- Runtime eventbus
8282
eventBus:
8383
# -- Eventbus name
84-
name: 'codefresh-eventbus'
84+
name: ''
8585
# -- Annotations on EventBus resource
8686
annotations: {}
8787
# -- Pod disruption budget for the eventbus

0 commit comments

Comments
 (0)