feat(argo-cd): Add ability to pass finalizers to AppProject (#982)

* feat(argo-cd): Add ability to pass finalizers to AppProject

Signed-off-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>

* chore: Use 'with' instead of 'if' and beautify indent style

Signed-off-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>

* docs: Add finalizers to example in values.yaml

Signed-off-by: Marco Kilchhofer <mkilchhofer@users.noreply.github.com>
This commit is contained in:
Marco Kilchhofer 2021-10-19 18:59:08 +02:00 committed by GitHub
parent fbea5aa49b
commit 694f8b4fe9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 25 deletions

View file

@ -2,7 +2,7 @@ apiVersion: v2
appVersion: 2.1.3
description: A Helm chart for ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes.
name: argo-cd
version: 3.25.3
version: 3.26.0
home: https://github.com/argoproj/argo-helm
icon: https://argo-cd.readthedocs.io/en/stable/assets/logo.png
keywords:
@ -21,4 +21,4 @@ dependencies:
condition: redis-ha.enabled
annotations:
artifacthub.io/changes: |
- "[Added]: Chart testing for HA setups"
- "[Added]: Ability to add finalizers to AppProject"

View file

@ -6,19 +6,23 @@ items:
- apiVersion: argoproj.io/v1alpha1
kind: AppProject
metadata:
{{- if .additionalAnnotations }}
{{- with .additionalAnnotations }}
annotations:
{{- range $key, $value := .additionalAnnotations }}
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
{{- if .additionalLabels }}
{{- with .additionalLabels }}
labels:
{{- toYaml .additionalLabels | nindent 8 }}
{{- toYaml . | nindent 8 }}
{{- end }}
name: {{ .name }}
{{- if .namespace }}
namespace: {{ .namespace }}
{{- with .namespace }}
namespace: {{ . }}
{{- end }}
{{- with .finalizers }}
finalizers:
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
description: {{ .description }}
@ -26,29 +30,29 @@ items:
{{- toYaml .sourceRepos | nindent 8 }}
destinations:
{{- toYaml .destinations | nindent 8 }}
{{- if .clusterResourceWhitelist }}
{{- with .clusterResourceWhitelist }}
clusterResourceWhitelist:
{{- toYaml .clusterResourceWhitelist | nindent 8 }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .namespaceResourceBlacklist }}
{{- with .namespaceResourceBlacklist }}
namespaceResourceBlacklist:
{{- toYaml .namespaceResourceBlacklist | nindent 8 }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .namespaceResourceWhitelist }}
{{- with .namespaceResourceWhitelist }}
namespaceResourceWhitelist:
{{- toYaml .namespaceResourceWhitelist | nindent 8 }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .orphanedResources }}
{{- with .orphanedResources }}
orphanedResources:
{{- toYaml .orphanedResources | nindent 8 }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .roles }}
{{- with .roles }}
roles:
{{- toYaml .roles | nindent 8 }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if .syncWindows }}
{{- with .syncWindows }}
syncWindows:
{{- toYaml .syncWindows | nindent 8 }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
{{- end }}

View file

@ -850,6 +850,8 @@ server:
# namespace: argocd
# additionalLabels: {}
# additionalAnnotations: {}
# finalizers:
# - resources-finalizer.argocd.argoproj.io
# project: guestbook
# source:
# repoURL: https://github.com/argoproj/argocd-example-apps.git
@ -880,6 +882,8 @@ server:
# namespace: argocd
# additionalLabels: {}
# additionalAnnotations: {}
# finalizers:
# - resources-finalizer.argocd.argoproj.io
# description: Example Project
# sourceRepos:
# - '*'