File tree Expand file tree Collapse file tree 9 files changed +22
-8
lines changed
charts/gitops-runtime/templates
_components/event-reporters
tests/component-tests/setup Expand file tree Collapse file tree 9 files changed +22
-8
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ metadata:
77 {{- include "event-reporters.rollout-reporter.labels" . | nindent 4}}
88spec :
99 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 }}
1111 resource :
1212 analysisruns :
1313 eventTypes :
Original file line number Diff line number Diff line change 1717 - name : analysisruns
1818 eventSourceName : rollout-reporter
1919 eventName : analysisruns
20- eventBusName : {{ default "codefresh-eventbus" .Values.global.runtime.eventBus.name }}
20+ eventBusName : {{ include "codefresh-gitops-runtime. eventbus.name " .Values.global.runtime.eventBus }}
2121 template :
2222 serviceAccountName : {{ include "event-reporters.rollout-reporter.serviceAccountName" .}}
2323 container :
Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ metadata:
77 {{- include "event-reporters.workflow-reporter.labels" . | nindent 4 }}
88spec :
99 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 }}
1111 resource :
1212 workflows :
1313 eventTypes :
Original file line number Diff line number Diff line change 1111 - eventName : workflows
1212 eventSourceName : workflow-reporter
1313 name : workflows
14- eventBusName : {{ default "codefresh-eventbus" .Values.global.runtime.eventBus.name }}
14+ eventBusName : {{ include "codefresh-gitops-runtime. eventbus.name " .Values.global.runtime.eventBus }}
1515 template :
1616 serviceAccountName : {{ include "event-reporters.workflow-reporter.serviceAccountName" .}}
1717 container :
Original file line number Diff line number Diff line change @@ -507,3 +507,17 @@ valueFrom:
507507 optional: true
508508{ {- end } }
509509# ------------------------------------------------------------------------------------------------------------
510+
511+ { {- define " codefresh-gitops-runtime.eventbus.name" } }
512+ { {- $eventBusName := " " } }
513+ { {- $eventBusType := .type } }
514+ { {- if eq $eventBusType " nats" } }
515+ { {- $eventBusName = default " codefresh-eventbus" .name } }
516+ { {- else if eq $eventBusType " jetstream" } }
517+ { {- $eventBusName = default " codefresh-eventbus-jetstream" .name } }
518+ { {- else } }
519+ { {- fail (printf " ERROR: EventBus type %s is inavlid, must be nats|jetstream" $eventBusType ) } }
520+ { {- end } }
521+
522+ { {- printf " %s" $eventBusName } }
523+ { {- 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) }}
22{{- $eventBusSpec := .Values.global.runtime.eventBus }}
33{{- $eventBusType := .Values.global.runtime.eventBus.type }}
44{{/* Remove name from eventbus spec */}}
1616
1717{{- if eq $eventBusType "nats" }}
1818 {{- $eventBusSpec = unset $eventBusSpec "jetstream" }}
19- {{- $eventBusName = default "codefresh-eventbus" $eventBusName }}
2019 {{- $_ := set $eventBusSpec.nats.native "nodeSelector" ($eventBusSpec.nats.native.nodeSelector | default .Values.global.nodeSelector) }}
2120 {{- $_ := set $eventBusSpec.nats.native "tolerations" ($eventBusSpec.nats.native.tolerations | default .Values.global.tolerations) }}
2221{{- end }}
2322
2423{{- if eq $eventBusType "jetstream" }}
2524 {{- $eventBusSpec = unset $eventBusSpec "nats" }}
26- {{- $eventBusName = default "codefresh-eventbus-jetstream" $eventBusName }}
2725 {{- $_ := set $eventBusSpec.jetstream "nodeSelector" ($eventBusSpec.jetstream.nodeSelector | default .Values.global.nodeSelector) }}
2826 {{- $_ := set $eventBusSpec.jetstream "tolerations" ($eventBusSpec.jetstream.tolerations | default .Values.global.tolerations) }}
2927{{- 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) }}
22{{- if .Values.global.runtime.eventBus.pdb.enabled }}
33apiVersion : policy/v1
44kind : PodDisruptionBudget
Original file line number Diff line number Diff line change 1+ Subproject commit 36db6073a3c784095872b5243aeb1cbb31f85765
Original file line number Diff line number Diff line change 1+ Subproject commit 725c7353bd7859036d547c97b948734c91d30d61
You can’t perform that action at this time.
0 commit comments