-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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(appset): Advanced Templating using templatePatch #14893
feat(appset): Advanced Templating using templatePatch #14893
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #14893 +/- ##
=======================================
Coverage 49.49% 49.49%
=======================================
Files 269 270 +1
Lines 47389 47480 +91
=======================================
+ Hits 23454 23500 +46
- Misses 21630 21670 +40
- Partials 2305 2310 +5 ☔ View full report in Codecov by Sentry. |
For folks watching this issue: I really, really wanted to get it into 2.9 but ran out of time. We did manage to merge this slightly less-powerful tool, which should be sufficient for some use cases: #14743 |
@crenshaw-dev #14743 will save a lot of time. Thanks a lot. In parallel I will rebase this one and keep it ready for 2.10 |
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.
Even with patchTemplate -> templatePatch I'm still having problems getting it working with my test files. But that could be on my end. Will continue on it next week.
bc46257
to
39c3ed8
Compare
Hiya, I am having a problem where if
The above works fine without
|
@sethgupton-mastery as you are using goTemplate you must use |
Sweet. That fixed me up. I hadn't realized goTemplate was something that already existed and wasn't part of this PR. I was able to load a dynamic list of labels from my app.json file! Very exciting! Can't wait for this to get in. Thanks speedfl. |
I just read through the docs section and this feature looks really cool and would help out a ton! 🚀 Is this slated for |
Signed-off-by: gmuselli <geoffrey.muselli@gmail.com>
e8c354b
to
fcbe22a
Compare
Yep, slated for 2.10. Starting to review in earnest now. :-) |
Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
small changes
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.
Let's go 🚀
* fix(11164): Advanced templating using patchTemplate Signed-off-by: gmuselli <geoffrey.muselli@gmail.com> * small changes Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> --------- Signed-off-by: gmuselli <geoffrey.muselli@gmail.com> Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
* fix(11164): Advanced templating using patchTemplate Signed-off-by: gmuselli <geoffrey.muselli@gmail.com> * small changes Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> --------- Signed-off-by: gmuselli <geoffrey.muselli@gmail.com> Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
i'm trying this feature using this article : https://medium.com/@geoffrey.muselli/argocd-multi-cluster-helm-charts-installation-in-mono-repo-0a406ff7c578 building an image based on 2.10, get for each time get Error from server (BadRequest): error when creating "demo/argo-applicationset-template/applicationset-argo-monocluster.yaml": ApplicationSet in version "v1alpha1" cannot be handled as a ApplicationSet: strict decoding error: unknown field "Generator" |
Can you open a bug ? |
made a mistake in my config , sorry |
it's working for multi cluster, i just make some little adjustement , but enable to use the feature flag enabled. this is my applicationset, with that, i can get two clone on different cluster `
template: |
This is a support question. Could you please ask it on the cncf slack. Section argo-cd-appset. Thanks 🙂 |
Thanks for implementing this. Was any consideration given to the multiple source use case? i.e. the patching of a source that is a list element under An example of a desired ApplicationSet that doesn't currently work: apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
name: vpa
namespace: argocd
spec:
goTemplate: true
generators:
- merge:
mergeKeys:
- name
generators:
- clusters: {}
- list:
elements:
- name: dev
kustomizeComponents:
- components/dashboards
templatePatch: |
spec:
sources:
- ref: custom
kustomize:
components:
{{- range .kustomizeComponents }}
- {{ . }}
{{- end }}
template:
metadata:
name: 'vpa-{{.name}}'
namespace: argocd
labels:
environment: '{{.metadata.labels.environment}}'
spec:
sources:
- repoURL: https://github.com/LS80/vertical-pod-autoscaler.git
path: manifests/vpa
targetRevision: '{{ default "main" .targetRevision }}'
ref: custom
kustomize:
commonLabels:
environment: '{{.metadata.labels.environment}}'
- chart: vpa
repoURL: https://charts.fairwinds.com/stable
targetRevision: 2.1.0
helm:
releaseName: vpa
valuesObject:
updater:
enabled: false
project: default
destination:
name: '{{.name}}'
namespace: kube-system Here everything under |
This is a normal behavior but it could be probably improved. |
Yes I am looking for a way to avoid putting everything in a giant string under |
We are using a strategic merge patch so that strange |
Could you please open a bug with a minimal case to reproduce. I'll try to have a look |
I created #16800. Thanks for looking 👍 |
* fix(11164): Advanced templating using patchTemplate Signed-off-by: gmuselli <geoffrey.muselli@gmail.com> * small changes Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> --------- Signed-off-by: gmuselli <geoffrey.muselli@gmail.com> Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
* fix(11164): Advanced templating using patchTemplate Signed-off-by: gmuselli <geoffrey.muselli@gmail.com> * small changes Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> --------- Signed-off-by: gmuselli <geoffrey.muselli@gmail.com> Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> Signed-off-by: Kevin Lyda <kevin@lyda.ie>
* fix(11164): Advanced templating using patchTemplate Signed-off-by: gmuselli <geoffrey.muselli@gmail.com> * small changes Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> --------- Signed-off-by: gmuselli <geoffrey.muselli@gmail.com> Signed-off-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com> Co-authored-by: Michael Crenshaw <350466+crenshaw-dev@users.noreply.github.com>
Signed-off-by: gmuselli geoffrey.muselli@gmail.com
@crenshaw-dev a small proposal for
patchTemplate
Closes #11164
Closes #9177
Note on DCO:
If the DCO action in the integration test fails, one or more of your commits are not signed off. Please click on the Details link next to the DCO action for instructions on how to resolve this.
Checklist: