Skip to content

Commit 1c4da57

Browse files
feat: support acr controller in our chart
1 parent 65ed48f commit 1c4da57

File tree

3 files changed

+35
-42
lines changed

3 files changed

+35
-42
lines changed

charts/argo-cd/templates/_helpers.tpl

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,3 +285,20 @@ Helper template to set argocd server url in event reporter
285285
{{- end }}
286286
{{- printf "%s:%v" (include "argo-cd.server.fullname" .) $port }}
287287
{{- end -}}
288+
289+
{{/*
290+
Create acr controller name and version as used by the chart label.
291+
*/}}
292+
{{- define "argo-cd.acr-controller.fullname" -}}
293+
{{- printf "%s-%s" (include "argo-cd.fullname" .) .Values.acrController.name | trunc 63 | trimSuffix "-" -}}
294+
{{- end -}}
295+
{{/*
296+
Create the name of the acr controller service account to use
297+
*/}}
298+
{{- define "argo-cd.acrControllerServiceAccountName" -}}
299+
{{- if .Values.acrController.serviceAccount.create -}}
300+
{{ default (include "argo-cd.event-reporter.fullname" .) .Values.acrController.serviceAccount.name }}
301+
{{- else -}}
302+
{{ default "default" .Values.acrController.serviceAccount.name }}
303+
{{- end -}}
304+
{{- end -}}

charts/argo-cd/templates/acr-controller/clusterrole.yaml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@ rules:
1212
{{- toYaml .Values.acrController.clusterRoleRules.rules | nindent 2 }}
1313
{{- else }}
1414
- apiGroups:
15-
- '*'
15+
- argoproj.io
1616
resources:
17-
- '*'
17+
- applications
1818
verbs:
19-
- '*'
20-
- nonResourceURLs:
21-
- '*'
22-
verbs:
23-
- '*'
24-
{{- end }}
19+
- get
20+
- list
21+
- watch
22+
- patch
23+
- update
24+
{{- end }}
2525
{{- end }}
2626
{{- end }}

charts/argo-cd/templates/acr-controller/role.yaml

Lines changed: 10 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -7,38 +7,14 @@ metadata:
77
labels:
88
{{- include "argo-cd.labels" (dict "context" . "component" .Values.acrController.name "name" .Values.acrController.name) | nindent 4 }}
99
rules:
10-
- apiGroups:
11-
- ""
12-
resources:
13-
- secrets
14-
- configmaps
15-
verbs:
16-
- create
17-
- get
18-
- list
19-
- watch
20-
- update
21-
- patch
22-
- delete
23-
- apiGroups:
24-
- argoproj.io
25-
resources:
26-
- applications
27-
- appprojects
28-
- applicationsets
29-
verbs:
30-
- create
31-
- get
32-
- list
33-
- watch
34-
- update
35-
- delete
36-
- patch
37-
- apiGroups:
38-
- ""
39-
resources:
40-
- events
41-
verbs:
42-
- create
43-
- list
10+
- apiGroups:
11+
- argoproj.io
12+
resources:
13+
- applications
14+
verbs:
15+
- get
16+
- list
17+
- watch
18+
- patch
19+
- update
4420
{{- end }}

0 commit comments

Comments
 (0)