Skip to content

Commit d6de0c8

Browse files
committed
feat(event-reporters): restore codefresh-sa service account for backward compatibility
- Add event-reporters.workflow.serviceAccount configuration to values.yaml - Add helper functions for workflow reporter service account in _helpers.tpl - Create workflow-reporter-sa.yaml template to provision codefresh-sa service account - Maintains backward compatibility with e2e tests and existing workflows - Service account created only when event-reporters.workflow.serviceAccount.create is true - Defaults to 'codefresh-sa' name when no custom name is specified Resolves e2e test failures due to missing codefresh-sa service account after event-reporters removal.
1 parent 1479c71 commit d6de0c8

File tree

3 files changed

+52
-0
lines changed

3 files changed

+52
-0
lines changed

charts/gitops-runtime/templates/_helpers.tpl

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -507,3 +507,32 @@ valueFrom:
507507
optional: true
508508
{{- end }}
509509
# ------------------------------------------------------------------------------------------------------------
510+
511+
# ------------------------------------------------------------------------------------------------------------
512+
# event-reporters workflow reporter helpers (backward compatibility)
513+
# ------------------------------------------------------------------------------------------------------------
514+
{{/*
515+
Create the name of the service account to use for workflow reporter
516+
*/}}
517+
{{- define "event-reporters.workflow-reporter.serviceAccountName" -}}
518+
{{- if (index .Values "event-reporters" "workflow" "serviceAccount" "create") }}
519+
{{- default "codefresh-sa" (index .Values "event-reporters" "workflow" "serviceAccount" "name") }}
520+
{{- else }}
521+
{{- default "default" (index .Values "event-reporters" "workflow" "serviceAccount" "name") }}
522+
{{- end }}
523+
{{- end }}
524+
525+
{{/*
526+
Common labels for workflow reporter
527+
*/}}
528+
{{- define "event-reporters.workflow-reporter.labels" -}}
529+
helm.sh/chart: {{ include "codefresh-gitops-runtime.chart" . }}
530+
app.kubernetes.io/name: workflow-reporter
531+
app.kubernetes.io/instance: {{ .Release.Name }}
532+
{{- if .Chart.AppVersion }}
533+
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
534+
{{- end }}
535+
app.kubernetes.io/managed-by: Helm
536+
codefresh.io/internal: "true"
537+
{{- end }}
538+
# ------------------------------------------------------------------------------------------------------------
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{{/*
2+
Workflow reporter service account for backward compatibility
3+
*/}}
4+
{{- if (index .Values "event-reporters" "workflow" "serviceAccount" "create") }}
5+
apiVersion: v1
6+
kind: ServiceAccount
7+
metadata:
8+
name: {{ include "event-reporters.workflow-reporter.serviceAccountName" . }}
9+
labels:
10+
{{- include "event-reporters.workflow-reporter.labels" . | nindent 4 }}
11+
{{- end }}

charts/gitops-runtime/values.yaml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -660,6 +660,18 @@ gitops-operator:
660660
cpu: 100m
661661
memory: 128Mi
662662

663+
#-----------------------------------------------------------------------------------------------------------------------
664+
# event-reporters (backward compatibility)
665+
#-----------------------------------------------------------------------------------------------------------------------
666+
# -- Event reporters configuration for backward compatibility
667+
event-reporters:
668+
workflow:
669+
serviceAccount:
670+
# -- Create service account for workflow reporter
671+
create: true
672+
# -- Service account name (defaults to codefresh-sa if not specified)
673+
name: ""
674+
663675
#-----------------------------------------------------------------------------------------------------------------------
664676
# cf-argocd-extras
665677
#-----------------------------------------------------------------------------------------------------------------------

0 commit comments

Comments
 (0)