-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(argocd-apps): Support Template Patch to ApplicationSet #2549
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
yu-croco
commented
Feb 24, 2024
Comment on lines
+87
to
+90
{{- with .templatePatch }} | ||
templatePatch: | | ||
{{- . | nindent 4 }} | ||
{{- end }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Signed-off-by: yu-croco <yu.croco@gmail.com>
yu-croco
force-pushed
the
support-templatePatch
branch
from
February 24, 2024 12:33
cf252e0
to
f1eed57
Compare
mkilchhofer
approved these changes
Feb 24, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Rendered output
$ helm template . --values ci/applicationsets-values.yaml
---
# Source: argocd-apps/templates/applicationsets.yaml
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: applicationset
spec:
generators:
- git:
directories:
- path: guestbook
- path: kustomize-*
repoURL: https://github.com/argoproj/argocd-example-apps.git
revision: HEAD
ignoreApplicationDifferences:
- jsonPointers:
- /spec/syncPolicy
syncPolicy:
preserveResourcesOnDeletion: false
template:
metadata:
name: '{{path.basename}}'
spec:
project: 'default'
source:
path: '{{path}}'
repoURL: https://github.com/argoproj/argocd-example-apps.git
targetRevision: HEAD
destination:
namespace: default
server: https://kubernetes.default.svc
syncPolicy:
automated:
prune: false
selfHeal: false
ignoreDifferences:
- group: apps
jsonPointers:
- /spec/replicas
kind: Deployment
info:
- name: url
value: https://argoproj.github.io/
templatePatch: |
spec:
source:
helm:
valueFiles:
{{- range $valueFile := .valueFiles }}
- {{ $valueFile }}
{{- end }}
{{- if .autoSync }}
syncPolicy:
automated:
prune: {{ .prune }}
{{- end }}
---
# Source: argocd-apps/templates/applicationsets.yaml
apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: applicationset-list-generator
spec:
generators:
- list:
elements:
- cluster: engineering-dev
url: https://kubernetes.default.svc
template:
metadata: {}
spec:
destination: {}
project: '{{cluster}}'
source:
path: applicationset/examples/template-override/{{cluster}}-override
repoURL: https://github.com/argoproj/argo-cd.git
targetRevision: HEAD
template:
metadata:
name: '{{cluster}}-guestbook'
spec:
project: '{{cluster}}'
source:
path: applicationset/examples/template-override/default
repoURL: https://github.com/argoproj/argo-cd.git
targetRevision: HEAD
destination:
namespace: guestbook
server: '{{url}}'
LGTM |
pdrastil
approved these changes
Feb 25, 2024
thank you! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolves #2463
Checklist: