How to pass the image version in the notification #13615
-
Hi, Thx |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 12 replies
-
Have you tried fetching that value from the application status field, i.e. with something like this: template.app-sync-succeeded: |
email:
subject: Application {{.app.metadata.name}} has been successfully synced.
message: |
{{if eq .serviceType “slack”}}:white_check_mark:{{end}} Application {{.app.metadata.name}} has been successfully synced at {{.app.status.operationState.finishedAt}}.
Sync operation details are available at: {{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true .
slack:
attachments: |
[{
“title”: “{{.app.metadata.name}} {{ $image := first .app.status.summary.images }}{{ $list := splitList “:” $image }}{{ index $list 1 }}“, |
Beta Was this translation helpful? Give feedback.
-
This works for me
|
Beta Was this translation helpful? Give feedback.
-
ok, what if i only want the :1.0 the version part only ... not the whole url ? is there a way to truncate that string ? regex maybe ? |
Beta Was this translation helpful? Give feedback.
This works for me