Skip to content

Commit

Permalink
update argo apps
Browse files Browse the repository at this point in the history
  • Loading branch information
juri committed Mar 8, 2024
1 parent f9145b5 commit c964fd0
Show file tree
Hide file tree
Showing 16 changed files with 496 additions and 78 deletions.
2 changes: 1 addition & 1 deletion charts/app/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: app
description: A Helm chart for Kubernetes Deployment
type: application

version: 0.13.6
version: 0.13.7

keywords:
- deployment
Expand Down
2 changes: 1 addition & 1 deletion charts/argo-applications/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: argo-applications
description: A Helm chart for Kubernetes argo applications
type: application

version: 0.13.6
version: 0.13.7

keywords:
- argocd
Expand Down
39 changes: 26 additions & 13 deletions charts/argo-applications/templates/applications.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{{- if .Values.server.additionalApplications }}
{{- $appDefaults := .Values.server.additionalApplicationsDefaults -}}
{{- if .Values.applications }}
{{- $appDefaults := .Values.applicationsDefaults -}}
apiVersion: v1
kind: List
items:
{{- range $appValuesOrig := .Values.server.additionalApplications }}
{{- range $appValuesOrig := .Values.applications }}
{{- $appValues := mergeOverwrite (dict) (deepCopy $appDefaults) $appValuesOrig }}
- apiVersion: argoproj.io/v1alpha1
kind: Application
Expand All @@ -14,31 +14,44 @@ items:
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
{{- if $appValues.additionalLabels }}
{{- with $appValues.additionalLabels }}
labels:
{{- toYaml $appValues.additionalLabels | nindent 8 }}
{{- toYaml . | nindent 8 }}
{{- end }}
name: {{ .name }}
{{- if $appValues.namespace }}
namespace: {{ $appValues.namespace }}
{{- end }}
{{- if $appValues.finalizers }}
{{- with $appValues.finalizers }}
finalizers:
{{- toYaml $appValues.finalizers | nindent 8 }}
{{- toYaml . | nindent 8 }}
{{- end }}
spec:
project: {{ tpl $appValues.project $ }}
{{- with $appValues.source }}
source:
{{- toYaml $appValues.source | nindent 8 }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with $appValues.sources }}
sources:
{{- toYaml . | nindent 8 }}
{{- end }}
destination:
{{- toYaml $appValues.destination | nindent 8 }}
{{- if $appValues.syncPolicy }}
{{- toYaml $appValues.destination | nindent 4 }}
{{- with $appValues.syncPolicy }}
syncPolicy:
{{- toYaml $appValues.syncPolicy | nindent 8 }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- if $appValues.ignoreDifferences }}
{{- with $appValues.revisionHistoryLimit }}
revisionHistoryLimit: {{ . }}
{{- end }}
{{- with $appValues.ignoreDifferences }}
ignoreDifferences:
{{- toYaml $appValues.ignoreDifferences | nindent 8 }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with $appValues.info }}
info:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end }}
{{- end }}
91 changes: 91 additions & 0 deletions charts/argo-applications/templates/applicationsets.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@

{{- range .Values.applicationsets }}
---
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
{{- with .additionalAnnotations }}
annotations:
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
{{- with .additionalLabels }}
labels:
{{- toYaml . | nindent 4 }}
{{- end }}
name: {{ .name }}
{{- with .namespace }}
namespace: {{ . }}
{{- end }}
spec:
{{- if hasKey . "goTemplate" }}
goTemplate: {{ .goTemplate }}
{{- end }}
{{- with .generators }}
generators:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .ignoreApplicationDifferences }}
ignoreApplicationDifferences:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .strategy }}
strategy:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .syncPolicy }}
syncPolicy:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .template }}
template:
{{- with .metadata }}
metadata:
{{- with .annotations }}
annotations:
{{- range $key, $value := . }}
{{ $key }}: {{ $value | squote }}
{{- end }}
{{- end }}
{{- with .labels }}
labels:
{{- toYaml . | nindent 8 }}
{{- end }}
name: {{ .name | squote }}
{{- with .namespace }}
namespace: {{ . | squote }}
{{- end }}
{{- end }}
{{- with .spec }}
spec:
project: {{ .project | squote }}
{{- with .source }}
source:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .sources }}
sources:
{{- toYaml . | nindent 8 }}
{{- end }}
destination:
{{- toYaml .destination | nindent 8 }}
{{- with .syncPolicy }}
syncPolicy:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .ignoreDifferences }}
ignoreDifferences:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .info }}
info:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- end -}}
{{- end }}
{{- with .templatePatch }}
templatePatch: |
{{- . | nindent 4 }}
{{- end }}
{{- end }}
27 changes: 27 additions & 0 deletions charts/argo-applications/templates/extensions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{{- range .Values.extensions }}
---
apiVersion: argoproj.io/v1alpha1
kind: ArgoCDExtension
metadata:
name: {{ .name }}
{{- with .namespace }}
namespace: {{ . }}
{{- end }}
finalizers:
- extensions-finalizer.argocd.argoproj.io
{{- with .additionalLabels }}
labels:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .additionalAnnotations }}
annotations:
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
{{- with .sources }}
spec:
sources:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
15 changes: 15 additions & 0 deletions charts/argo-applications/templates/item-templates.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{{- range .Values.itemTemplates }}
{{- if kindIs "string" .template }}
{{- $template := .template -}}
{{- range .items }}
---
{{ tpl $template (set . "Template" $.Template) }}
{{- end }}
{{- else }}
{{- $template := .template | toYaml -}}
{{- range .items }}
---
{{ tpl $template (set . "Template" $.Template) }}
{{- end }}
{{- end }}
{{- end }}
125 changes: 72 additions & 53 deletions charts/argo-applications/templates/projects.yaml
Original file line number Diff line number Diff line change
@@ -1,54 +1,73 @@
{{- if .Values.server.additionalProjects }}
apiVersion: v1
kind: List
items:
{{- range .Values.server.additionalProjects }}
- apiVersion: argoproj.io/v1alpha1
kind: AppProject
metadata:
{{- if .additionalAnnotations }}
annotations:
{{- range $key, $value := .additionalAnnotations }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
{{- if .additionalLabels }}
labels:
{{- toYaml .additionalLabels | nindent 8 }}
{{- end }}
name: {{ .name }}
{{- if .namespace }}
namespace: {{ .namespace }}
{{- end }}
spec:
description: {{ .description }}
sourceRepos:
{{- toYaml .sourceRepos | nindent 8 }}
destinations:
{{- toYaml .destinations | nindent 8 }}
{{- if .clusterResourceWhitelist }}
clusterResourceWhitelist:
{{- toYaml .clusterResourceWhitelist | nindent 8 }}
{{- end }}
{{- if .namespaceResourceBlacklist }}
namespaceResourceBlacklist:
{{- toYaml .namespaceResourceBlacklist | nindent 8 }}
{{- end }}
{{- if .namespaceResourceWhitelist }}
namespaceResourceWhitelist:
{{- toYaml .namespaceResourceWhitelist | nindent 8 }}
{{- end }}
{{- if .orphanedResources }}
orphanedResources:
{{- toYaml .orphanedResources | nindent 8 }}
{{- end }}
{{- if .roles }}
roles:
{{- toYaml .roles | nindent 8 }}
{{- end }}
{{- if .syncWindows }}
syncWindows:
{{- toYaml .syncWindows | nindent 8 }}
{{- end }}
{{- end }}
{{- range .Values.projects }}
---
apiVersion: argoproj.io/v1alpha1
kind: AppProject
metadata:
{{- with .additionalAnnotations }}
annotations:
{{- range $key, $value := . }}
{{ $key }}: {{ $value | quote }}
{{- end }}
{{- end }}
{{- with .additionalLabels }}
labels:
{{- toYaml . | nindent 4 }}
{{- end }}
name: {{ .name }}
{{- with .namespace }}
namespace: {{ . }}
{{- end }}
{{- with .finalizers }}
finalizers:
{{- toYaml . | nindent 4 }}
{{- end }}
spec:
{{- with .permitOnlyProjectScopedClusters }}
permitOnlyProjectScopedClusters: {{ . }}
{{- end }}
description: {{ .description }}
{{- with .sourceRepos }}
sourceRepos:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .destinations }}
destinations:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .clusterResourceWhitelist }}
clusterResourceWhitelist:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .clusterResourceBlacklist }}
clusterResourceBlacklist:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .namespaceResourceBlacklist }}
namespaceResourceBlacklist:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .namespaceResourceWhitelist }}
namespaceResourceWhitelist:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .orphanedResources }}
orphanedResources:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .roles }}
roles:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .syncWindows }}
syncWindows:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .signatureKeys }}
signatureKeys:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- with .sourceNamespaces }}
sourceNamespaces:
{{- toYaml . | nindent 4 }}
{{- end }}
{{- end }}
Loading

0 comments on commit c964fd0

Please sign in to comment.