I have the following:
apiVersion: kind: Application metadata: name: crm namespace: default spec: project: default source: repoURL: <my url targetRevision: argocd path: argocd/ destination: server: namespace: default syncPolicy: syncOptions: - CreateNamespace=true automated: selfHeal: true prune: true This is working to connect argocd with the main branch, but what if I want it to follow a different branch instead?
Thank you.
1 Answer
No, your example above will make the ArgoCD application load content from:
- repo: "<my url"
- targetRevision (branch): "argocd"
- path (ie. path in repo): "argocd/" meaning it won't load from main/master branch!
Use targetRevision to specify the branch you require if source is a Git repo URL.
See excerpt from the ArgoCD application.yaml docs:
# Source of the application manifests source: repoURL: # Can point to either a Helm chart repo or a git repo. targetRevision: HEAD # For Helm, this refers to the chart version. path: guestbook # This has no meaning for Helm charts pulled directly from a Helm repo instead of git. 1