Skip to content

Commit

Permalink
Added ability to set all on server field use cluster generators (#125)
Browse files Browse the repository at this point in the history
  • Loading branch information
saidsef authored Nov 30, 2023
1 parent 8216ff9 commit dbb9a22
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 6 deletions.
6 changes: 3 additions & 3 deletions charts/applicationset/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
4 changes: 2 additions & 2 deletions charts/applicationset/README.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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 |
Expand Down
7 changes: 7 additions & 0 deletions charts/applicationset/templates/github-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ spec:
syncPolicy:
preserveResourcesOnDeletion: false
generators:
{{- if eq $server "all" }}
- clusters: {}
{{- end }}
- pullRequest:
github:
api: {{ $github.api }}
Expand Down Expand Up @@ -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 }}
7 changes: 7 additions & 0 deletions charts/applicationset/templates/gitlab-mr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ spec:
syncPolicy:
preserveResourcesOnDeletion: false
generators:
{{- if eq $server "all" }}
- clusters: {}
{{- end }}
- pullRequest:
gitlab:
api: {{ $gitlab.api }}
Expand Down Expand Up @@ -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 }}
2 changes: 1 addition & 1 deletion charts/applicationset/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit dbb9a22

Please sign in to comment.