feat: support acr controller in our chart

This commit is contained in:
pashakostohrys 2024-09-26 14:48:07 +03:00
parent 65ed48fb12
commit 1c4da57ab5
3 changed files with 35 additions and 42 deletions

View file

@ -285,3 +285,20 @@ Helper template to set argocd server url in event reporter
{{- end }}
{{- printf "%s:%v" (include "argo-cd.server.fullname" .) $port }}
{{- end -}}
{{/*
Create acr controller name and version as used by the chart label.
*/}}
{{- define "argo-cd.acr-controller.fullname" -}}
{{- printf "%s-%s" (include "argo-cd.fullname" .) .Values.acrController.name | trunc 63 | trimSuffix "-" -}}
{{- end -}}
{{/*
Create the name of the acr controller service account to use
*/}}
{{- define "argo-cd.acrControllerServiceAccountName" -}}
{{- if .Values.acrController.serviceAccount.create -}}
{{ default (include "argo-cd.event-reporter.fullname" .) .Values.acrController.serviceAccount.name }}
{{- else -}}
{{ default "default" .Values.acrController.serviceAccount.name }}
{{- end -}}
{{- end -}}

View file

@ -12,15 +12,15 @@ rules:
{{- toYaml .Values.acrController.clusterRoleRules.rules | nindent 2 }}
{{- else }}
- apiGroups:
- '*'
- argoproj.io
resources:
- '*'
- applications
verbs:
- '*'
- nonResourceURLs:
- '*'
verbs:
- '*'
{{- end }}
- get
- list
- watch
- patch
- update
{{- end }}
{{- end }}
{{- end }}

View file

@ -7,38 +7,14 @@ metadata:
labels:
{{- include "argo-cd.labels" (dict "context" . "component" .Values.acrController.name "name" .Values.acrController.name) | nindent 4 }}
rules:
- apiGroups:
- ""
resources:
- secrets
- configmaps
verbs:
- create
- get
- list
- watch
- update
- patch
- delete
- apiGroups:
- argoproj.io
resources:
- applications
- appprojects
- applicationsets
verbs:
- create
- get
- list
- watch
- update
- delete
- patch
- apiGroups:
- ""
resources:
- events
verbs:
- create
- list
- apiGroups:
- argoproj.io
resources:
- applications
verbs:
- get
- list
- watch
- patch
- update
{{- end }}