Interview Prep/GitOps & Argo CD/ApplicationSets, App-of-Apps & Multi-Cluster

What is `templatePatch` in an ApplicationSet?

AdvancedConceptApplicationSets, App-of-Apps & Multi-Cluster
Answer

A Go-template string that renders to a patch applied on top of the generated Application, available with goTemplate: true. It enables conditional structure that the plain template cannot express, such as adding automated sync only for non-prod or adding extra value files when a parameter is set:

templatePatch: |
  {{- if eq .env "dev" }}
  spec:
    syncPolicy:
      automated: {prune: true, selfHeal: true}
  {{- end }}
All GitOps & Argo CD questions Roadmap: Argo CD (GitOps)

More on ApplicationSets, App-of-Apps & Multi-Cluster