0

I have multiple apps (helm) deployed via argocd (app of apps pattern), all residing in folders in same git repository: app1, app2, app3... appN. I am using argocd-notifications. I have configured trigger for on-deployed event (from example in helm chart):

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

and default subsciption:

  subscriptions:
    - recipients:
      - slack:release
      triggers:
      - on-deployed

Now if I change file(s) in app1 folder, trigger is firing on all other apps as well: app2, app3 ... appN, spamming slack with unneeded messages about apps that are not affected by change and are not actually deployed. I want to be notified only about apps that are actually updated/deployed. Is there any workaround to achieve this?

gio
  • 337
  • 3
  • 8
  • do you have your app of apps on automatic sync? maybe just use automatic sync on the child apps. – Pierre Oct 08 '21 at 17:44

2 Answers2

0

I had the same issue. What worked for me was the following trigger

     oncePer: app.status.syncResult.revision and app.metadata.name
     send:
     - app-deployed
     when: app.status.operationState.phase in ['Succeeded'] and 
     app.status.health.status == 'Healthy'

In this case, I get 2 notifications per release, one for the app of apps and the second for the app itself. If you are not interested in the app of apps notification you can also filter this out. Though in my case is fine to have 2 notifications because I have an aggregation service before the notification goes to slack.

0
oncePer: app.status.operationState.syncResult.revision

I have it working like this.

mihma
  • 1