From c87678a4c9e66abbf713e7a35d50749cfdc8e3d4 Mon Sep 17 00:00:00 2001 From: Said Sef Date: Tue, 26 Sep 2023 20:54:08 +0100 Subject: [PATCH] Added ability to set all on server field use cluster generators --- charts/applicationset/Chart.yaml | 6 +++--- charts/applicationset/README.md | 4 ++-- charts/applicationset/templates/github-pr.yml | 7 +++++++ charts/applicationset/templates/gitlab-mr.yml | 7 +++++++ charts/applicationset/values.yaml | 2 +- 5 files changed, 20 insertions(+), 6 deletions(-) diff --git a/charts/applicationset/Chart.yaml b/charts/applicationset/Chart.yaml index 118d708..ba64fcb 100644 --- a/charts/applicationset/Chart.yaml +++ b/charts/applicationset/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v2 name: argocd-applicationsets-services description: A Helm chart for ArgoCD ApplicationSets, a declarative, GitOps continuous delivery tool for Kubernetes type: application -version: &version "0.11.9" +version: &version "0.12.0" appVersion: *version kubeVersion: ">= 1.23" home: https://github.com/saidsef/argocd-applicationsets-services @@ -23,8 +23,8 @@ sources: annotations: artifacthub.io/license: "Apache-2.0" artifacthub.io/changes: | - - kind: changed - description: Version bump to fix CI deployment + - kind: added + description: Enabled ability to set all on server field use cluster generators artifacthub.io/links: | - name: README url: https://raw.githubusercontent.com/saidsef/argocd-applicationsets-services/main/README.md diff --git a/charts/applicationset/README.md b/charts/applicationset/README.md index 7198867..0a6d391 100644 --- a/charts/applicationset/README.md +++ b/charts/applicationset/README.md @@ -1,6 +1,6 @@ # argocd-applicationsets-services -![Version: 0.11.9](https://img.shields.io/badge/Version-0.11.9-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.11.9](https://img.shields.io/badge/AppVersion-0.11.9-informational?style=flat-square) +![Version: 0.12.0](https://img.shields.io/badge/Version-0.12.0-informational?style=flat-square) ![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square) ![AppVersion: 0.12.0](https://img.shields.io/badge/AppVersion-0.12.0-informational?style=flat-square) A Helm chart for ArgoCD ApplicationSets, a declarative, GitOps continuous delivery tool for Kubernetes @@ -33,7 +33,7 @@ Kubernetes: `>= 1.23` | globals.requeueAfterSeconds | int | `500` | GitHub polling rate (seconds) | | globals.retryBackoffDuration | string | `"10s"` | The amount to back off retries of failed syncs | | globals.revisionHistoryLimit | int | `2` | How many old objects should be retained | -| globals.server | string | `"https://kubernetes.default.svc"` | ArgoCD server address | +| globals.server | string | `"https://kubernetes.default.svc"` | ArgoCD server address, use 'all' to use cluster generator | | name | string | `"pr-reviews"` | ApplicationSet name | | namespace | string | `"argocd"` | ArgoCD controller Namespace deployed | | project | object | `{"clusterResourceBlacklist":[{"group":"apiextensions.k8s.io","kind":"CustomResourceDefinition"}],"clusterResourceWhitelist":[{"group":"*","kind":"*"}],"destinations":[{"name":"*","namespace":"previews","server":"*"}],"enabled":false,"namespaceResourceBlacklist":[{"group":"argoproj.io","kind":"AppProject"}],"namespaceResourceWhitelist":[{"group":"*","kind":"*"}],"orphanedResources":{"warn":false},"permitOnlyProjectScopedClusters":false,"roles":[],"sourceRepos":["*"],"syncWindows":[]}` | ArgoCD Project parameters | diff --git a/charts/applicationset/templates/github-pr.yml b/charts/applicationset/templates/github-pr.yml index b8af610..e41ce73 100644 --- a/charts/applicationset/templates/github-pr.yml +++ b/charts/applicationset/templates/github-pr.yml @@ -31,6 +31,9 @@ spec: syncPolicy: preserveResourcesOnDeletion: false generators: + {{- if eq $server "all" }} + - clusters: {} + {{- end }} - pullRequest: github: api: {{ $github.api }} @@ -114,7 +117,11 @@ spec: backoff: duration: {{ $retryBackoffDuration }} destination: + {{- if eq $server "all" }} + server: '{{ $dqf }}server{{ $dqb }}' + {{- else }} server: {{ $server }} + {{- end }} namespace: {{ coalesce $repo.namespace $.Values.globals.deployToNamespace (printf "mr-%sbranch_slug%s-%snumber%s" $dqf $dqb $dqf $dqb) }} {{- end }} {{- end }} diff --git a/charts/applicationset/templates/gitlab-mr.yml b/charts/applicationset/templates/gitlab-mr.yml index d20db43..52b4145 100644 --- a/charts/applicationset/templates/gitlab-mr.yml +++ b/charts/applicationset/templates/gitlab-mr.yml @@ -30,6 +30,9 @@ spec: syncPolicy: preserveResourcesOnDeletion: false generators: + {{- if eq $server "all" }} + - clusters: {} + {{- end }} - pullRequest: gitlab: api: {{ $gitlab.api }} @@ -113,7 +116,11 @@ spec: backoff: duration: {{ $retryBackoffDuration }} destination: + {{- if eq $server "all" }} + server: '{{ $dqf }}server{{ $dqb }}' + {{- else }} server: {{ $server }} + {{- end }} namespace: {{ coalesce $repo.namespace $.Values.globals.deployToNamespace (printf "mr-%sbranch_slug%s-%snumber%s" $dqf $dqb $dqf $dqb) }} {{- end }} {{- end }} diff --git a/charts/applicationset/values.yaml b/charts/applicationset/values.yaml index 2ed6a93..5c7adf4 100644 --- a/charts/applicationset/values.yaml +++ b/charts/applicationset/values.yaml @@ -15,7 +15,7 @@ globals: # -- (string) The amount to back off retries of failed syncs retryBackoffDuration: '10s' - # -- ArgoCD server address + # -- ArgoCD server address, use 'all' to use cluster generator server: 'https://kubernetes.default.svc' # -- ArgoCD Slack notification channel