Replies: 3 comments 1 reply
-
Yeah revision doesn't work for us for this reason and because we have manifests defined for a number of different apps in the same repo; when one of them is updated, all of them get synced. I've got our template filtering out the correct image nicely now using the Image Updater annotations: template.mixpanel-annotation-app-version: |
webhook:
mixpanel:
method: POST
path: app/projects/{{ .recipient }}/annotations
body: |
{{- $match := "" -}}
{{- range $deployedImage := .app.status.summary.images -}}
{{- range $configuredImage := split "," (index $.app.metadata.annotations "argocd-image-updater.argoproj.io/image-list") -}}
{{- $configuredImage := (regexReplaceAll "(.*)(:.*)$" (index (split "=" $configuredImage) "_1") "${1}") -}}
{{- if contains $configuredImage $deployedImage -}}
{{- $match = $deployedImage -}}
{{- end -}}
{{- end -}}
{{- end -}}
{
"date": "{{ (call .time.Now).Local.Format "2006-01-02 15:04:05" }}",
"description": "MY_EKS_CLUSTER | {{ base $match }}"
} I can't figure out a way to get to it trigger only when one of the images in the list you mentioned changes though 😕 |
Beta Was this translation helpful? Give feedback.
-
Also, I found that most of Helm functions works in template |
Beta Was this translation helpful? Give feedback.
-
I had a similar situation wherein I was getting a lot of notifications. To reduce that, I resorted to
And it seems to work. Argo can take image list and remember that. The only problem I face is that quite often I get the image tag of the last one as summary is updated a bit late I guess. So I'll try to fetch image tag from |
Beta Was this translation helpful? Give feedback.
-
Hello, I am currently struggling with setting up notification once per image tag or app version.
There is only an example in the docs with
oncePer: app.status.operationState.syncResult.revision
, but for my case I only want to send notification when the app version changes itself rather than every change in yaml configs.The
app
object has only one path that contains what I need -app.status.summary.images
, but it is a list of container images which can vary.If
oncePer
was accepting value instead of path I would be able to achieve what I need, but I guess it is not possible (any links to the source code of how it is implemented maybe?)My question is how can I make argocd notification send only on image tag change or app version? Is there any standards to do this the right way?
Beta Was this translation helpful? Give feedback.
All reactions