Files
139de0ee5c feat: ApplicationSet Go template (#10026)
* ApplicationSet Go Template

Signed-off-by: Geoffrey Muselli <[email protected]>

* go template improvements

Signed-off-by: CI <[email protected]>

* update go mod

Signed-off-by: CI <[email protected]>

* fix tests

Signed-off-by: CI <[email protected]>

* fix tests

Signed-off-by: CI <[email protected]>

* fix tests

Signed-off-by: CI <[email protected]>

* Add tests for error handling

Signed-off-by: Geoffrey Muselli <[email protected]>

Co-authored-by: CI <[email protected]>
2022-08-08 11:50:53 -04:00

34 lines
903 B
YAML

# The cluster generator produces an items list from all clusters registered to Argo CD.
# It automatically provides the following fields as values to the app template:
# - name
# - server
# - metadata.labels.<key>
# - metadata.annotations.<key>
# - values.<key>
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: guestbook
spec:
generators:
- clusters:
selector:
matchLabels:
argocd.argoproj.io/secret-type: cluster
values:
project: default
template:
metadata:
name: '{{.name}}-guestbook'
labels:
environment: '{{.metadata.labels.environment}}'
spec:
project: '{{.values.project}}'
source:
repoURL: https://github.com/infra-team/cluster-deployments.git
targetRevision: HEAD
chart: guestbook
destination:
server: '{{.server}}'
namespace: guestbook