@@ -9,6 +9,8 @@ metadata:
99 name : docker-build-{{ .name }}
1010 annotations :
1111 sidecar.istio.io/inject : " false"
12+ # ArgoCD sync wave annotation to ensure it's applied first
13+ argocd.argoproj.io/sync-wave : " -2"
1214 labels : {{- include "team-ns.chart-labels" $ | nindent 4 }}
1315spec :
1416 workspaces :
@@ -85,6 +87,8 @@ apiVersion: triggers.tekton.dev/v1alpha1
8587kind : TriggerTemplate
8688metadata :
8789 name : trigger-template-{{ .name }}
90+ annotations :
91+ argocd.argoproj.io/sync-wave : " -1"
8892 labels : {{- include "team-ns.chart-labels" $ | nindent 4 }}
8993spec :
9094 resourcetemplates :
@@ -137,13 +141,16 @@ spec:
137141 secretName : harbor-pushsecret-builds
138142---
139143{{- else }}
144+ # Create PipelineRun with a higher sync wave to ensure it's created after the Pipeline
140145apiVersion : tekton.dev/v1
141146kind : PipelineRun
142147metadata :
143148 name : docker-build-{{ .name }}
144149 annotations :
145150 sidecar.istio.io/inject : " false"
146151 argocd.argoproj.io/compare-options : IgnoreExtraneous
152+ # ArgoCD sync wave annotation to ensure it's applied after the pipeline
153+ argocd.argoproj.io/sync-wave : " 5"
147154 labels : {{- include "team-ns.chart-labels" $ | nindent 4 }}
148155spec :
149156 pipelineRef :
@@ -189,6 +196,8 @@ apiVersion: triggers.tekton.dev/v1alpha1
189196kind : TriggerBinding
190197metadata :
191198 name : gitea-triggerbinding-{{ .name }}
199+ annotations :
200+ argocd.argoproj.io/sync-wave : " -1"
192201 labels : {{- include "team-ns.chart-labels" $ | nindent 4 }}
193202spec :
194203 params :
@@ -201,6 +210,8 @@ apiVersion: triggers.tekton.dev/v1alpha1
201210kind : EventListener
202211metadata :
203212 name : gitea-webhook-{{ .name }}
213+ annotations :
214+ argocd.argoproj.io/sync-wave : " -1"
204215 labels :
205216 tekton.dev/pipeline : docker-build-{{ .name }}
206217 {{- include "team-ns.chart-labels" $ | nindent 4 }}
@@ -216,4 +227,4 @@ spec:
216227---
217228{{- end }}
218229{{- end }}
219- {{- end }}
230+ {{- end }}
0 commit comments