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:
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 @@ -522,3 +522,17 @@ HTTPS_PROXY: {{ .Values.global.httpsProxy }}
522522NO_PROXY: { { .Values.global.noProxy } }
523523 { {- end } }
524524{ {- 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) }}
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
You can’t perform that action at this time.
0 commit comments