Skip to content

Commit 79e6ccb

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 807b6de commit 79e6ccb

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
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: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ global:
8484

8585
# -- Runtime eventbus
8686
eventBus:
87-
# -- Eventbus name
88-
name: 'codefresh-eventbus'
87+
# -- Eventbus name
88+
name: ''
8989
# -- Annotations on EventBus resource
9090
annotations: {}
9191
# -- Pod disruption budget for the eventbus

0 commit comments

Comments
 (0)