ArgoCD not triggering notification on sync success

943 views Asked by At

I am trying to set up a notification for older argocd version 2.4.15, but keep struggling with this behavior:

level=info msg="Processing skipped: sync status out of date"

It happens whenever a new commit is synced and the app is deployed.

I have an argocd-notification ConfigMap:

data:
  context: |
    argocdUrl: #REDACTED
  service.webhook.mattermost: |
    url: #REDACTED
  subscriptions: |
    - recipients:
      - mattermost
      triggers:
      - on-deployed

and here is a trigger:

  trigger.on-deployed: |
    - description: Application is synced and healthy. Triggered once per commit.
      oncePer: app.status.sync.revision
      send:
      - mattermost-app-deployed
      when: app.status.operationState.phase in ['Succeeded'] and app.status.health.status == 'Healthy'
1

There are 1 answers

0
wesleywh On

For me the issue was that my annotations (the subscriptions to your triggers) was on my Deployment or (Rollout) object. All of these must exist on the kind: Application object.

So you need to add your annotation subscriptions under that object:

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  annotations:
    notifications.argoproj.io/subscribe.<trigger>.<service>: <recipients>

In the docs it also talks about adding universal subscriptions using a kind: AppProject deployment as well.

Docs: https://argo-cd.readthedocs.io/en/stable/user-guide/subscriptions/