feat(argocd-apps)!: use maps instead of lists (#2538)

* feat(argocd-apps)!: use maps instead of lists

Signed-off-by: irizzant <i.rizzante@gmail.com>

* fix(chart): add artifacthub annotations

Signed-off-by: irizzant <i.rizzante@gmail.com>

* fix: remove not needed lines

Signed-off-by: irizzant <i.rizzante@gmail.com>

* fix: use the right range function

Signed-off-by: irizzant <i.rizzante@gmail.com>

* fix(argocd-apps): fix issues

Signed-off-by: irizzant <i.rizzante@gmail.com>

* fix: fix newline issue in values.yaml

Signed-off-by: irizzant <i.rizzante@gmail.com>

* fix: Use range function properly (revert complex changes on item-templates)

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

---------

Signed-off-by: irizzant <i.rizzante@gmail.com>
Signed-off-by: Marco Maurer <mkilchhofer@users.noreply.github.com>
Co-authored-by: Jason Meridth <jmeridth@gmail.com>
Co-authored-by: Marco Maurer <mkilchhofer@users.noreply.github.com>
Co-authored-by: Aikawa <yu.croco@gmail.com>
This commit is contained in:
irizzant 2024-03-23 16:38:56 +01:00 committed by GitHub
parent 393402cb1b
commit 237493a4ab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 428 additions and 429 deletions

View file

@ -2,7 +2,7 @@ apiVersion: v2
name: argocd-apps name: argocd-apps
description: A Helm chart for managing additional Argo CD Applications and Projects description: A Helm chart for managing additional Argo CD Applications and Projects
type: application type: application
version: 1.6.2 version: 2.0.0
home: https://github.com/argoproj/argo-helm home: https://github.com/argoproj/argo-helm
icon: https://argo-cd.readthedocs.io/en/stable/assets/logo.png icon: https://argo-cd.readthedocs.io/en/stable/assets/logo.png
keywords: keywords:
@ -18,4 +18,4 @@ annotations:
url: https://argoproj.github.io/argo-helm/pgp_keys.asc url: https://argoproj.github.io/argo-helm/pgp_keys.asc
artifacthub.io/changes: | artifacthub.io/changes: |
- kind: added - kind: added
description: Support Template Patch to ApplicationSet description: make the chart use maps instead of lists

View file

@ -28,11 +28,11 @@ $ helm install my-release argo/argocd-apps
| Key | Type | Default | Description | | Key | Type | Default | Description |
|-----|------|---------|-------------| |-----|------|---------|-------------|
| applications | list | `[]` (See [values.yaml]) | Deploy Argo CD Applications within this helm release | | applications | object | `{}` (See [values.yaml]) | Deploy Argo CD Applications within this helm release |
| applicationsets | list | `[]` (See [values.yaml]) | Deploy Argo CD ApplicationSets within this helm release | | applicationsets | object | `{}` (See [values.yaml]) | Deploy Argo CD ApplicationSets within this helm release |
| extensions | list | `[]` (See [values.yaml]) | DEPRECATED - Please refer [Deprecation Notice](https://github.com/argoproj-labs/argocd-extensions?tab=readme-ov-file#deprecation-notice) for more info. | | extensions | object | `{}` (See [values.yaml]) | DEPRECATED - Please refer [Deprecation Notice](https://github.com/argoproj-labs/argocd-extensions?tab=readme-ov-file#deprecation-notice) for more info. |
| itemTemplates | list | `[]` (See [values.yaml]) | Deploy Argo CD Applications/ApplicationSets/Projects within this helm release | | itemTemplates | list | `[]` (See [values.yaml]) | Deploy Argo CD Applications/ApplicationSets/Projects within this helm release |
| projects | list | `[]` (See [values.yaml]) | Deploy Argo CD Projects within this helm release | | projects | object | `{}` (See [values.yaml]) | Deploy Argo CD Projects within this helm release |
---------------------------------------------- ----------------------------------------------
Autogenerated from chart metadata using [helm-docs](https://github.com/norwoodj/helm-docs) Autogenerated from chart metadata using [helm-docs](https://github.com/norwoodj/helm-docs)

View file

@ -1,7 +1,7 @@
# Test with multi-source applications # Test with multi-source applications
applications: applications:
- name: argocd-application-multiple-sources argocd-application-multiple-sources:
additionalLabels: {} additionalLabels: {}
additionalAnnotations: {} additionalAnnotations: {}
finalizers: finalizers:

View file

@ -1,7 +1,7 @@
# Test with applications # Test with applications
applications: applications:
- name: argocd-application argocd-application:
additionalLabels: {} additionalLabels: {}
additionalAnnotations: {} additionalAnnotations: {}
finalizers: finalizers:

View file

@ -1,7 +1,7 @@
# Test with multi-source applicationsets # Test with multi-source applicationsets
applicationsets: applicationsets:
- name: applicationset-multiple-sources applicationset-multiple-sources:
generators: generators:
- list: - list:
elements: elements:

View file

@ -1,7 +1,7 @@
# Test applicationsets with Progressive Syncs # Test applicationsets with Progressive Syncs
applicationsets: applicationsets:
- name: applicationset-progressive-syncs applicationset-progressive-syncs:
generators: generators:
- list: - list:
elements: elements:

View file

@ -1,7 +1,7 @@
# Test with applicationsets # Test with applicationsets
applicationsets: applicationsets:
- name: applicationset applicationset:
additionalLabels: {} additionalLabels: {}
additionalAnnotations: {} additionalAnnotations: {}
# See PR #10026 (ArgoCD v2.5 or later) # See PR #10026 (ArgoCD v2.5 or later)
@ -59,7 +59,7 @@ applicationsets:
automated: automated:
prune: {{ .prune }} prune: {{ .prune }}
{{- end }} {{- end }}
- name: applicationset-list-generator applicationset-list-generator:
generators: generators:
- list: - list:
elements: elements:

View file

@ -1,50 +1,50 @@
{{- range .Values.applications }} {{- range $appName, $appData:= .Values.applications }}
--- ---
apiVersion: argoproj.io/v1alpha1 apiVersion: argoproj.io/v1alpha1
kind: Application kind: Application
metadata: metadata:
{{- with .additionalAnnotations }} {{- with $appData.additionalAnnotations }}
annotations: annotations:
{{- range $key, $value := . }} {{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }} {{ $key }}: {{ $value | quote }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- with .additionalLabels }} {{- with $appData.additionalLabels }}
labels: labels:
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}
{{- end }} {{- end }}
name: {{ .name }} name: {{ $appName }}
{{- with .namespace }} {{- with $appData.namespace }}
namespace: {{ . }} namespace: {{ . }}
{{- end }} {{- end }}
{{- with .finalizers }} {{- with $appData.finalizers }}
finalizers: finalizers:
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}
{{- end }} {{- end }}
spec: spec:
project: {{ tpl .project $ }} project: {{ tpl $appData.project $ }}
{{- with .source }} {{- with $appData.source }}
source: source:
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}
{{- end }} {{- end }}
{{- with .sources }} {{- with $appData.sources }}
sources: sources:
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}
{{- end }} {{- end }}
destination: destination:
{{- toYaml .destination | nindent 4 }} {{- toYaml $appData.destination | nindent 4 }}
{{- with .syncPolicy }} {{- with $appData.syncPolicy }}
syncPolicy: syncPolicy:
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}
{{- end }} {{- end }}
{{- with .revisionHistoryLimit }} {{- with $appData.revisionHistoryLimit }}
revisionHistoryLimit: {{ . }} revisionHistoryLimit: {{ . }}
{{- end }} {{- end }}
{{- with .ignoreDifferences }} {{- with $appData.ignoreDifferences }}
ignoreDifferences: ignoreDifferences:
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}
{{- end }} {{- end }}
{{- with .info }} {{- with $appData.info }}
info: info:
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}
{{- end }} {{- end }}

View file

@ -1,44 +1,43 @@
{{- range $appSetName, $appSetData:= .Values.applicationsets }}
{{- range .Values.applicationsets }}
--- ---
apiVersion: argoproj.io/v1alpha1 apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet kind: ApplicationSet
metadata: metadata:
{{- with .additionalAnnotations }} {{- with $appSetData.additionalAnnotations }}
annotations: annotations:
{{- range $key, $value := . }} {{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }} {{ $key }}: {{ $value | quote }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- with .additionalLabels }} {{- with $appSetData.additionalLabels }}
labels: labels:
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}
{{- end }} {{- end }}
name: {{ .name }} name: {{ $appSetName }}
{{- with .namespace }} {{- with $appSetData.namespace }}
namespace: {{ . }} namespace: {{ . }}
{{- end }} {{- end }}
spec: spec:
{{- if hasKey . "goTemplate" }} {{- if hasKey $appSetData "goTemplate" }}
goTemplate: {{ .goTemplate }} goTemplate: {{ $appSetData.goTemplate }}
{{- end }} {{- end }}
{{- with .generators }} {{- with $appSetData.generators }}
generators: generators:
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}
{{- end }} {{- end }}
{{- with .ignoreApplicationDifferences }} {{- with $appSetData.ignoreApplicationDifferences }}
ignoreApplicationDifferences: ignoreApplicationDifferences:
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}
{{- end }} {{- end }}
{{- with .strategy }} {{- with $appSetData.strategy }}
strategy: strategy:
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}
{{- end }} {{- end }}
{{- with .syncPolicy }} {{- with $appSetData.syncPolicy }}
syncPolicy: syncPolicy:
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}
{{- end }} {{- end }}
{{- with .template }} {{- with $appSetData.template }}
template: template:
{{- with .metadata }} {{- with .metadata }}
metadata: metadata:
@ -84,7 +83,7 @@ spec:
{{- end }} {{- end }}
{{- end -}} {{- end -}}
{{- end }} {{- end }}
{{- with .templatePatch }} {{- with $appSetData.templatePatch }}
templatePatch: | templatePatch: |
{{- . | nindent 4 }} {{- . | nindent 4 }}
{{- end }} {{- end }}

View file

@ -1,25 +1,25 @@
{{- range .Values.extensions }} {{- range $extensionName, $extensionData:= .Values.extensions }}
--- ---
apiVersion: argoproj.io/v1alpha1 apiVersion: argoproj.io/v1alpha1
kind: ArgoCDExtension kind: ArgoCDExtension
metadata: metadata:
name: {{ .name }} name: {{ $extensionName }}
{{- with .namespace }} {{- with $extensionData.namespace }}
namespace: {{ . }} namespace: {{ . }}
{{- end }} {{- end }}
finalizers: finalizers:
- extensions-finalizer.argocd.argoproj.io - extensions-finalizer.argocd.argoproj.io
{{- with .additionalLabels }} {{- with $extensionData.additionalLabels }}
labels: labels:
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}
{{- end }} {{- end }}
{{- with .additionalAnnotations }} {{- with $extensionData.additionalAnnotations }}
annotations: annotations:
{{- range $key, $value := . }} {{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }} {{ $key }}: {{ $value | quote }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- with .sources }} {{- with $extensionData.sources }}
spec: spec:
sources: sources:
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}

View file

@ -1,72 +1,72 @@
{{- range .Values.projects }} {{- range $projectName, $projectData := .Values.projects }}
--- ---
apiVersion: argoproj.io/v1alpha1 apiVersion: argoproj.io/v1alpha1
kind: AppProject kind: AppProject
metadata: metadata:
{{- with .additionalAnnotations }} {{- with $projectData.additionalAnnotations }}
annotations: annotations:
{{- range $key, $value := . }} {{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }} {{ $key }}: {{ $value | quote }}
{{- end }} {{- end }}
{{- end }} {{- end }}
{{- with .additionalLabels }} {{- with $projectData.additionalLabels }}
labels: labels:
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}
{{- end }} {{- end }}
name: {{ .name }} name: {{ $projectName }}
{{- with .namespace }} {{- with $projectData.namespace }}
namespace: {{ . }} namespace: {{ . }}
{{- end }} {{- end }}
{{- with .finalizers }} {{- with $projectData.finalizers }}
finalizers: finalizers:
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}
{{- end }} {{- end }}
spec: spec:
{{- with .permitOnlyProjectScopedClusters }} {{- with $projectData.permitOnlyProjectScopedClusters }}
permitOnlyProjectScopedClusters: {{ . }} permitOnlyProjectScopedClusters: {{ . }}
{{- end }} {{- end }}
description: {{ .description }} description: {{ $projectData.description }}
{{- with .sourceRepos }} {{- with $projectData.sourceRepos }}
sourceRepos: sourceRepos:
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}
{{- end }} {{- end }}
{{- with .destinations }} {{- with $projectData.destinations }}
destinations: destinations:
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}
{{- end }} {{- end }}
{{- with .clusterResourceWhitelist }} {{- with $projectData.clusterResourceWhitelist }}
clusterResourceWhitelist: clusterResourceWhitelist:
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}
{{- end }} {{- end }}
{{- with .clusterResourceBlacklist }} {{- with $projectData.clusterResourceBlacklist }}
clusterResourceBlacklist: clusterResourceBlacklist:
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}
{{- end }} {{- end }}
{{- with .namespaceResourceBlacklist }} {{- with $projectData.namespaceResourceBlacklist }}
namespaceResourceBlacklist: namespaceResourceBlacklist:
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}
{{- end }} {{- end }}
{{- with .namespaceResourceWhitelist }} {{- with $projectData.namespaceResourceWhitelist }}
namespaceResourceWhitelist: namespaceResourceWhitelist:
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}
{{- end }} {{- end }}
{{- with .orphanedResources }} {{- with $projectData.orphanedResources }}
orphanedResources: orphanedResources:
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}
{{- end }} {{- end }}
{{- with .roles }} {{- with $projectData.roles }}
roles: roles:
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}
{{- end }} {{- end }}
{{- with .syncWindows }} {{- with $projectData.syncWindows }}
syncWindows: syncWindows:
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}
{{- end }} {{- end }}
{{- with .signatureKeys }} {{- with $projectData.signatureKeys }}
signatureKeys: signatureKeys:
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}
{{- end }} {{- end }}
{{- with .sourceNamespaces }} {{- with $projectData.sourceNamespaces }}
sourceNamespaces: sourceNamespaces:
{{- toYaml . | nindent 4 }} {{- toYaml . | nindent 4 }}
{{- end }} {{- end }}

View file

@ -1,8 +1,8 @@
# -- Deploy Argo CD Applications within this helm release # -- Deploy Argo CD Applications within this helm release
# @default -- `[]` (See [values.yaml]) # @default -- `{}` (See [values.yaml])
## Ref: https://github.com/argoproj/argo-cd/blob/master/docs/operator-manual/ ## Ref: https://github.com/argoproj/argo-cd/blob/master/docs/operator-manual/
applications: [] applications: {}
# - name: guestbook # guestbook:
# namespace: argocd # namespace: argocd
# additionalLabels: {} # additionalLabels: {}
# additionalAnnotations: {} # additionalAnnotations: {}
@ -43,10 +43,10 @@ applications: []
# value: https://argoproj.github.io/ # value: https://argoproj.github.io/
# -- Deploy Argo CD Projects within this helm release # -- Deploy Argo CD Projects within this helm release
# @default -- `[]` (See [values.yaml]) # @default -- `{}` (See [values.yaml])
## Ref: https://github.com/argoproj/argo-cd/blob/master/docs/operator-manual/ ## Ref: https://github.com/argoproj/argo-cd/blob/master/docs/operator-manual/
projects: [] projects: {}
# - name: guestbook # guestbook:
# namespace: argocd # namespace: argocd
# additionalLabels: {} # additionalLabels: {}
# additionalAnnotations: {} # additionalAnnotations: {}
@ -90,10 +90,10 @@ projects: []
# - argocd # - argocd
# -- Deploy Argo CD ApplicationSets within this helm release # -- Deploy Argo CD ApplicationSets within this helm release
# @default -- `[]` (See [values.yaml]) # @default -- `{}` (See [values.yaml])
## Ref: https://argo-cd.readthedocs.io/en/stable/operator-manual/applicationset/ ## Ref: https://argo-cd.readthedocs.io/en/stable/operator-manual/applicationset/
applicationsets: [] applicationsets: {}
# - name: guestbook # guestbook:
# namespace: argocd # namespace: argocd
# additionalLabels: {} # additionalLabels: {}
# additionalAnnotations: {} # additionalAnnotations: {}
@ -238,16 +238,16 @@ itemTemplates: []
# namespace: guestbook # namespace: guestbook
# -- DEPRECATED - Please refer [Deprecation Notice](https://github.com/argoproj-labs/argocd-extensions?tab=readme-ov-file#deprecation-notice) for more info. # -- DEPRECATED - Please refer [Deprecation Notice](https://github.com/argoproj-labs/argocd-extensions?tab=readme-ov-file#deprecation-notice) for more info.
# @default -- `[]` (See [values.yaml]) # @default -- `{}` (See [values.yaml])
## This function in tech preview stage, do expect unstability or breaking changes in newer versions. Bump image.tag if necessary. ## This function in tech preview stage, do expect unstability or breaking changes in newer versions. Bump image.tag if necessary.
## Ref: https://github.com/argoproj-labs/argocd-extensions ## Ref: https://github.com/argoproj-labs/argocd-extensions
extensions: [] extensions: {}
# - name: example # example:
# namespace: argocd # namespace: argocd
# additionalLabels: {} # additionalLabels: {}
# additionalAnnotations: {} # additionalAnnotations: {}
# sources: # sources:
# - git: # - git:
# url: https://github.com/argoproj-labs/argocd-example-extension.git # url: https://github.com/argoproj-labs/argocd-example-extension.git
# - web: # - web:
# url: https://github.com/argoproj-labs/argocd-example-extension/releases/download/v0.1.0/extension.tar # url: https://github.com/argoproj-labs/argocd-example-extension/releases/download/v0.1.0/extension.tar