argoproj / argo-cd

Declarative Continuous Deployment for Kubernetes
https://argo-cd.readthedocs.io
Apache License 2.0
18.05k stars 5.51k forks source link

argocd-nofitication - on-deployed notifying on pod replacement #19847

Open omerap12 opened 2 months ago

omerap12 commented 2 months ago

Checklist:

Describe the bug

To Reproduce Set the following notitication config map:

apiVersion: v1
kind: ConfigMap
metadata:
  name: argocd-notifications-cm
  namespace: argocd
data:
  context: |
    argocdUrl: https://url.com # switch to valid url
  service.slack: |
    token: $slack-token
  service.github: |
    appID: $githubAppID
    installationID: $githubAppInstallationID
    privateKey: $githubAppPrivateKey

  template.app-deployed: |
    email:
      subject: New version of an application {{.app.metadata.name}} is up and running.
    message: |
      {{if eq .serviceType "slack"}}:white_check_mark:{{end}} New version of *{{.app.metadata.name}}* is deployed.
    slack:
      attachments: |
        [{
          "color": "#18be52",
          "fields": [
          {
            "title": "Author",
            "value": "{{(call .repo.GetCommitMetadata (index .app.status.sync.revisions 0)).Author}}",
            "short": true
          },
          {
            "title": "Message",
            "value": "{{(call .repo.GetCommitMetadata (index .app.status.sync.revisions 0)).Message}}",
            "short": true
          },
          {
            "title": "Repository",
            "value": "{{(index .app.spec.sources 0).repoURL}}",
            "short": true
          }
          {{range $index, $image := .app.status.summary.images}}
            {{if not $index}},{{end}}
            {{if $index}},{{end}}
            {{$parts := split ":" $image}}
            {
              {{if eq $index 0}}
              "title": "New-Version",
              {{- else -}}
              "title": "Old-Version",
              {{- end}}
              "value":"{{$parts._1}}",
              "short": true
            }
          {{end}}
          ]
        }]
      deliveryPolicy: Post
      groupingKey: ""
      notifyBroadcast: false

    github:
      repoURLPath: "{{(index .app.spec.sources 0).repoURL}}"
      revisionPath: "{{index .app.status.sync.revisions 0}}"
      status:
        state: success
        label: "continuous-delivery/{{.app.metadata.name}}"

  template.app-health-degraded: |
    email:
      subject: Application {{.app.metadata.name}} has degraded.
    message: |
      {{if eq .serviceType "slack"}}:exclamation:{{end}} Application {{.app.metadata.name}} has degraded.
      Application details: {{.context.argocdUrl}}/applications/{{.app.metadata.name}}.
    slack:
      attachments: |
        [{
          "title": "{{ .app.metadata.name}}",
          "title_link": "{{.context.argocdUrl}}/applications/{{.app.metadata.name}}",
          "color": "#f4c030",
          "fields": [
          {
            "title": "Health Status",
            "value": "{{.app.status.health.status}}",
            "short": true
          },
          {
            "title": "Repository",
            "value": "{{(index .app.spec.sources 0).repoURL}}",
            "short": true
          }
          {{range $index, $c := .app.status.conditions}}
          {{if not $index}},{{end}}
          {{if $index}},{{end}}
          {
            "title": "{{$c.type}}",
            "value": "{{$c.message}}",
            "short": true
          }
          {{end}}
          ]
        }]
      deliveryPolicy: Post
      groupingKey: ""
      notifyBroadcast: false

  template.app-sync-failed: |
      email:
        subject: Failed to sync application {{.app.metadata.name}}.
      message: |
        {{if eq .serviceType "slack"}}:exclamation:{{end}}  The sync operation of application {{.app.metadata.name}} has failed at {{.app.status.operationState.finishedAt}} with the following error: {{.app.status.operationState.message}}
        Sync operation details are available at: {{.context.argocdUrl}}/applications/{{.app.metadata.name}}?operation=true .
      slack:
        attachments: |
          [{
            "title": "{{ .app.metadata.name}}",
            "title_link":"{{.context.argocdUrl}}/applications/{{.app.metadata.name}}",
            "color": "#E96D76",
            "fields": [
            {
              "title": "Sync Status",
              "value": "{{.app.status.sync.status}}",
              "short": true
            },
            {
              "title": "Repository",
              "value": "{{.app.spec.source.repoURL}}",
              "short": true
            }
            {{range $index, $c := .app.status.conditions}}
            {{if not $index}},{{end}}
            {{if $index}},{{end}}
            {
              "title": "{{$c.type}}",
              "value": "{{$c.message}}",
              "short": true
            }
            {{end}}
            ]
          }]
        deliveryPolicy: Post
        groupingKey: ""
        notifyBroadcast: false

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

  trigger.on-health-degraded: |
    - description: Application has degraded
      send:
      - app-health-degraded
      when: app.status.health.status == 'Degraded'

  trigger.on-sync-failed: |
    - description: Application syncing has failed
      send:
      - app-sync-failed
      when: app.status.operationState.phase in ['Error', 'Failed']

And have an application which manages applications sets in a mono repo:

apiVersion: argoproj.io/v1alpha1
kind: AppProject
metadata:
  name: devops
  namespace: argocd
spec:
  clusterResourceWhitelist:
  - group: '*'
    kind: '*'
  destinations:
  - namespace: '*'
    server: '*'
  sourceRepos:
  - '*'
---
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: master-application
  namespace: argocd
spec:
  destination:
    name: in-cluster
    namespace: argocd
  project: devops
  source:
    directory:
      recurse: true
      include: '{common/*,dir-1/*}'
      exclude: 'dir-1/master-applications.yaml'
    repoURL: https://github.com/repo-url # switch to your repo url
    path: argocd/manifests
    targetRevision: argocd
  syncPolicy:
    automated:
      prune: true
      selfHeal: true

This is an example of application-set which the master-application managed:

apiVersion: argoproj.io/v1alpha1
kind: ApplicationSet
metadata:
  name: applicationset-deployments-integration
  namespace: argocd
spec:
  generators:
    - git:
        repoURL: https://github.com/repo-url # switch to your repo url
        revision: argocd
        files:
          - path: "**/deployments/**/integration_eu-west-1.yaml"

  template:
    metadata:
      name: '{{path[2]}}-integration'
      annotations:
        notifications.argoproj.io/subscribe.on-deployed.slack: argo-alerts-{{path[0]}}
        notifications.argoproj.io/subscribe.on-deployed.github: ""
        notifications.argoproj.io/subscribe.on-health-degraded.slack: argo-alerts-{{path[0]}}
        notifications.argoproj.io/subscribe.on-sync-failed.slack: argo-alerts-{{path[0]}}
        # argocd.argoproj.io/compare-options: IgnoreExtraneous
        argocd.argoproj.io/manifest-generate-paths: ./integration_eu-west-1.yaml;./global.yaml;../../global.yaml
    spec:
      project: default
      ignoreDifferences:
      - group: "*"
        kind: "*"
        managedFieldsManagers:
        - kube-controller-manager

      source: 
        repoURL: https://github.com/repo-url # switch to your repo url
      sources:
        - repoURL: https://github.com/repo-url # switch to your repo url
          targetRevision: argocd
          ref: values
        - repoURL: ghcr.io/devops-team/helm-charts
          targetRevision: 0.2.x
          chart: generic-deployment
          helm:
            parameters:
              - name: "serviceName"
                value: "{{path[2]}}"
              - name: "group"
                value: "{{path[0]}}"
              - name: "environment"
                value: "integration"
              - name: "environmentShortSign"
                value: "i"
              - name: "nameOverride"
                value: "{{path[2]}}"
              - name: "k8sClusterName"
                value: "k8scluster"
            valueFiles:
              - $values/global.yaml
              - $values/{{path[0]}}/{{path[1]}}/{{path[2]}}/integration_eu-west-1.yaml # Per app
      destination:
        name: in-cluster
        namespace: "{{path[0]}}-i"
      syncPolicy:
        automated:
          prune: true
          selfHeal: true
        syncOptions:
          - CreateNamespace=true

Now the problem is that although the docs specified that on-deployed trigger will be triggered only when: "Application is synced and healthy. Triggered once per commit." (https://argo-cd.readthedocs.io/en/stable/operator-manual/notifications/catalog/#getting-started) and I even specified that following:

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

In every pod replacement - which can caused by node replacement or manually by typing kubectl rollout restart deployment the notification on deployed will be triggered.

Expected behavior Trigger should be triggered once per commit ( as specified in the docs )

Screenshots

Version

argocd: v2.11.5+c4b283c
  BuildDate: 2024-07-15T21:28:56Z
  GitCommit: c4b283ce0c092aeda00c78ae7b3b2d3b28e7feec
  GitTreeState: clean
  GoVersion: go1.22.5
  Compiler: gc
  Platform: darwin/arm64
argocd-server: v2.12.3+6b9cd82
  BuildDate: 2024-08-27T11:57:48Z
  GitCommit: 6b9cd828c6e9807398869ad5ac44efd2c28422d6
  GitTreeState: clean
  GoVersion: go1.22.4
  Compiler: gc
  Platform: linux/amd64
  Kustomize Version: v5.4.2 2024-05-22T15:19:38Z
  Helm Version: v3.15.2+g1a500d5
  Kubectl Version: v0.29.6
  Jsonnet Version: v0.20.0

Logs

Paste any relevant application logs here.
andrii-korotkov-verkada commented 3 weeks ago

Can you check the value of app.status.operationState.syncResult.revision when this happens, please? Does it stay the same, changes or keeps flapping? We need to see whether it's related to a bug in oncePer logic or something else.

jdoylei commented 1 week ago

@omerap12 - I'm just adopting Argo CD Notifications in our Argo CD instance and researching the trigger definitions, and I came upon your issue here while searching issues. I notice that trigger.on-deployed in the notifications_catalog is slightly more elaborate than what you posted above:

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

Maybe one of the differences is crucial for the Argo CD you're running?

omerap12 commented 1 week ago

Can you check the value of app.status.operationState.syncResult.revision when this happens, please? Does it stay the same, changes or keeps flapping? We need to see whether it's related to a bug in oncePer logic or something else.

Sorry for the late response. app.status.operationState.syncResult.revision is empty string. Not sure what that means:

apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  annotations:
    argocd.argoproj.io/manifest-generate-paths: ./integration_us-east-1.yaml;./global.yaml;../../global.yaml
    notifications.argoproj.io/subscribe.on-deployed.slack: argo-alerts-devops
    notifications.argoproj.io/subscribe.on-health-degraded.slack: argo-alerts-devops
    notifications.argoproj.io/subscribe.on-sync-failed.slack: argo-alerts-devops
    notified.notifications.argoproj.io: '{"on-deployed:[0].Sr9K61nqol5A3vHdaIDszB8l_zE:slack:argo-alerts-devops":1732200871,"on-deployed:[0].y7b5sbwa2Q329JYH755peeq-fBs:slack:argo-alerts-devops":1725784195}'
  creationTimestamp: "2024-09-05T11:21:38Z"
  finalizers:
  - resources-finalizer.argocd.argoproj.io
  generation: 37458
  name: workflow-docker-build-integration
  namespace: argocd
  ownerReferences:
  - apiVersion: argoproj.io/v1alpha1
    blockOwnerDeletion: true
    controller: true
    kind: ApplicationSet
    name: applicationset-deployments-integration
    uid: e2ba2c3e-fdf5-4658-b132-b2a03d42f852
  resourceVersion: "568584267"
  uid: 693395b8-5531-45eb-9ca1-2b73f0635416
spec:
  destination:
    name: in-cluster
    namespace: devops-i
  project: default
  source:
    repoURL: https://github.com/company-DevOps/k8s-config-gts
  sources:
  - ref: values
    repoURL: https://github.com/company-DevOps/k8s-config-gts
    targetRevision: master
  - chart: company-generic-deployment
    helm:
      parameters:
      - name: group
        value: devops
      - name: environment
        value: integration
      - name: environmentShortSign
        value: i
      - name: nameOverride
        value: workflow-docker-build
      - name: k8sClusterName
        value: gts-p-us-east-1
      releaseName: workflow-docker-build
      valueFiles:
      - $values/devops/global.yaml
      - $values/devops/deployments/workflow-docker-build/global.yaml
      - $values/devops/deployments/workflow-docker-build/integration_us-east-1.yaml
    repoURL: ghcr.io/company-devops/helm-charts
    targetRevision: 0.x.x
  syncPolicy:
    automated:
      prune: true
      selfHeal: true
    syncOptions:
    - CreateNamespace=true
status:
  controllerNamespace: argocd
  health:
    status: Healthy
  history:
  - deployStartedAt: "2024-11-13T13:36:02Z"
    deployedAt: "2024-11-13T13:36:04Z"
    id: 40
    initiatedBy:
      username: admin
    revisions:
    - 8b7ad75cf5a40d95acffa0314344add852fdd208
    - 0.2.11
    source:
      repoURL: ""
    sources:
    - ref: values
      repoURL: https://github.com/company-DevOps/k8s-config-gts
      targetRevision: master
    - chart: company-generic-deployment
      helm:
        parameters:
        - name: group
          value: devops
        - name: environment
          value: integration
        - name: environmentShortSign
          value: i
        - name: nameOverride
          value: workflow-docker-build
        - name: k8sClusterName
          value: gts-p-us-east-1
        releaseName: workflow-docker-build
        valueFiles:
        - $values/devops/global.yaml
        - $values/devops/deployments/workflow-docker-build/global.yaml
        - $values/devops/deployments/workflow-docker-build/integration_us-east-1.yaml
      repoURL: ghcr.io/company-devops/helm-charts
      targetRevision: 0.2.x
  - deployStartedAt: "2024-11-13T14:46:15Z"
    deployedAt: "2024-11-13T14:46:17Z"
    id: 41
    initiatedBy:
      username: admin
    revisions:
    - 7c8057e99faa1b444f3a05b14666802bdda0eced
    - 0.2.11
    source:
      repoURL: ""
    sources:
    - ref: values
      repoURL: https://github.com/company-DevOps/k8s-config-gts
      targetRevision: master
    - chart: company-generic-deployment
      helm:
        parameters:
        - name: group
          value: devops
        - name: environment
          value: integration
        - name: environmentShortSign
          value: i
        - name: nameOverride
          value: workflow-docker-build
        - name: k8sClusterName
          value: gts-p-us-east-1
        releaseName: workflow-docker-build
        valueFiles:
        - $values/devops/global.yaml
        - $values/devops/deployments/workflow-docker-build/global.yaml
        - $values/devops/deployments/workflow-docker-build/integration_us-east-1.yaml
      repoURL: ghcr.io/company-devops/helm-charts
      targetRevision: 0.2.x
  - deployStartedAt: "2024-11-14T12:06:49Z"
    deployedAt: "2024-11-14T12:06:53Z"
    id: 42
    initiatedBy:
      username: admin
    revisions:
    - 43394858ed3c430fc393b530b240a1886f593ccc
    - 0.2.11
    source:
      repoURL: ""
    sources:
    - ref: values
      repoURL: https://github.com/company-DevOps/k8s-config-gts
      targetRevision: master
    - chart: company-generic-deployment
      helm:
        parameters:
        - name: group
          value: devops
        - name: environment
          value: integration
        - name: environmentShortSign
          value: i
        - name: nameOverride
          value: workflow-docker-build
        - name: k8sClusterName
          value: gts-p-us-east-1
        releaseName: workflow-docker-build
        valueFiles:
        - $values/devops/global.yaml
        - $values/devops/deployments/workflow-docker-build/global.yaml
        - $values/devops/deployments/workflow-docker-build/integration_us-east-1.yaml
      repoURL: ghcr.io/company-devops/helm-charts
      targetRevision: 0.2.x
  - deployStartedAt: "2024-11-14T12:14:39Z"
    deployedAt: "2024-11-14T12:14:41Z"
    id: 43
    initiatedBy:
      username: admin
    revisions:
    - 4bed327da67185f66918a3648dd6df22270e8042
    - 0.2.11
    source:
      repoURL: ""
    sources:
    - ref: values
      repoURL: https://github.com/company-DevOps/k8s-config-gts
      targetRevision: master
    - chart: company-generic-deployment
      helm:
        parameters:
        - name: group
          value: devops
        - name: environment
          value: integration
        - name: environmentShortSign
          value: i
        - name: nameOverride
          value: workflow-docker-build
        - name: k8sClusterName
          value: gts-p-us-east-1
        releaseName: workflow-docker-build
        valueFiles:
        - $values/devops/global.yaml
        - $values/devops/deployments/workflow-docker-build/global.yaml
        - $values/devops/deployments/workflow-docker-build/integration_us-east-1.yaml
      repoURL: ghcr.io/company-devops/helm-charts
      targetRevision: 0.2.x
  - deployStartedAt: "2024-11-14T12:16:22Z"
    deployedAt: "2024-11-14T12:16:23Z"
    id: 44
    initiatedBy:
      username: admin
    revisions:
    - 4bed327da67185f66918a3648dd6df22270e8042
    - 0.2.11
    source:
      repoURL: ""
    sources:
    - ref: values
      repoURL: https://github.com/company-DevOps/k8s-config-gts
      targetRevision: master
    - chart: company-generic-deployment
      helm:
        parameters:
        - name: group
          value: devops
        - name: environment
          value: integration
        - name: environmentShortSign
          value: i
        - name: nameOverride
          value: workflow-docker-build
        - name: k8sClusterName
          value: gts-p-us-east-1
        releaseName: workflow-docker-build
        valueFiles:
        - $values/devops/global.yaml
        - $values/devops/deployments/workflow-docker-build/global.yaml
        - $values/devops/deployments/workflow-docker-build/integration_us-east-1.yaml
      repoURL: ghcr.io/company-devops/helm-charts
      targetRevision: 0.2.x
  - deployStartedAt: "2024-11-15T08:27:49Z"
    deployedAt: "2024-11-15T08:27:51Z"
    id: 45
    initiatedBy:
      username: admin
    revisions:
    - 6558f06882fabd6fc1e093cda440c9a6c8a4e69e
    - 0.2.11
    source:
      repoURL: ""
    sources:
    - ref: values
      repoURL: https://github.com/company-DevOps/k8s-config-gts
      targetRevision: master
    - chart: company-generic-deployment
      helm:
        parameters:
        - name: group
          value: devops
        - name: environment
          value: integration
        - name: environmentShortSign
          value: i
        - name: nameOverride
          value: workflow-docker-build
        - name: k8sClusterName
          value: gts-p-us-east-1
        releaseName: workflow-docker-build
        valueFiles:
        - $values/devops/global.yaml
        - $values/devops/deployments/workflow-docker-build/global.yaml
        - $values/devops/deployments/workflow-docker-build/integration_us-east-1.yaml
      repoURL: ghcr.io/company-devops/helm-charts
      targetRevision: 0.2.x
  - deployStartedAt: "2024-11-18T10:01:04Z"
    deployedAt: "2024-11-18T10:01:06Z"
    id: 46
    initiatedBy:
      username: admin
    revisions:
    - f61d8dc164f7ac47f286b48a109cdaf716476167
    - 0.2.11
    source:
      repoURL: ""
    sources:
    - ref: values
      repoURL: https://github.com/company-DevOps/k8s-config-gts
      targetRevision: master
    - chart: company-generic-deployment
      helm:
        parameters:
        - name: group
          value: devops
        - name: environment
          value: integration
        - name: environmentShortSign
          value: i
        - name: nameOverride
          value: workflow-docker-build
        - name: k8sClusterName
          value: gts-p-us-east-1
        releaseName: workflow-docker-build
        valueFiles:
        - $values/devops/global.yaml
        - $values/devops/deployments/workflow-docker-build/global.yaml
        - $values/devops/deployments/workflow-docker-build/integration_us-east-1.yaml
      repoURL: ghcr.io/company-devops/helm-charts
      targetRevision: 0.2.x
  - deployStartedAt: "2024-11-18T11:14:05Z"
    deployedAt: "2024-11-18T11:14:07Z"
    id: 47
    initiatedBy:
      username: admin
    revisions:
    - a96f47b54c7831dd4769398b37c2f81e471cf967
    - 0.2.11
    source:
      repoURL: ""
    sources:
    - ref: values
      repoURL: https://github.com/company-DevOps/k8s-config-gts
      targetRevision: master
    - chart: company-generic-deployment
      helm:
        parameters:
        - name: group
          value: devops
        - name: environment
          value: integration
        - name: environmentShortSign
          value: i
        - name: nameOverride
          value: workflow-docker-build
        - name: k8sClusterName
          value: gts-p-us-east-1
        releaseName: workflow-docker-build
        valueFiles:
        - $values/devops/global.yaml
        - $values/devops/deployments/workflow-docker-build/global.yaml
        - $values/devops/deployments/workflow-docker-build/integration_us-east-1.yaml
      repoURL: ghcr.io/company-devops/helm-charts
      targetRevision: 0.2.x
  - deployStartedAt: "2024-11-18T11:26:41Z"
    deployedAt: "2024-11-18T11:26:43Z"
    id: 48
    initiatedBy:
      username: admin
    revisions:
    - 9f2be6da1ae9931eecc9ccbad4179a95a07a9c36
    - 0.2.11
    source:
      repoURL: ""
    sources:
    - ref: values
      repoURL: https://github.com/company-DevOps/k8s-config-gts
      targetRevision: master
    - chart: company-generic-deployment
      helm:
        parameters:
        - name: group
          value: devops
        - name: environment
          value: integration
        - name: environmentShortSign
          value: i
        - name: nameOverride
          value: workflow-docker-build
        - name: k8sClusterName
          value: gts-p-us-east-1
        releaseName: workflow-docker-build
        valueFiles:
        - $values/devops/global.yaml
        - $values/devops/deployments/workflow-docker-build/global.yaml
        - $values/devops/deployments/workflow-docker-build/integration_us-east-1.yaml
      repoURL: ghcr.io/company-devops/helm-charts
      targetRevision: 0.2.x
  - deployStartedAt: "2024-11-20T14:07:18Z"
    deployedAt: "2024-11-20T14:07:20Z"
    id: 49
    initiatedBy:
      automated: true
    revisions:
    - 6cc24b59366c73dc87d20dfb3cf09982cc1040e8
    - 0.3.13
    source:
      repoURL: ""
    sources:
    - ref: values
      repoURL: https://github.com/company-DevOps/k8s-config-gts
      targetRevision: master
    - chart: company-generic-deployment
      helm:
        parameters:
        - name: group
          value: devops
        - name: environment
          value: integration
        - name: environmentShortSign
          value: i
        - name: nameOverride
          value: workflow-docker-build
        - name: k8sClusterName
          value: gts-p-us-east-1
        releaseName: workflow-docker-build
        valueFiles:
        - $values/devops/global.yaml
        - $values/devops/deployments/workflow-docker-build/global.yaml
        - $values/devops/deployments/workflow-docker-build/integration_us-east-1.yaml
      repoURL: ghcr.io/company-devops/helm-charts
      targetRevision: 0.x.x
  operationState:
    finishedAt: "2024-11-20T14:07:20Z"
    message: successfully synced (all tasks run)
    operation:
      initiatedBy:
        automated: true
      retry:
        limit: 5
      sync:
        prune: true
        revisions:
        - 6cc24b59366c73dc87d20dfb3cf09982cc1040e8
        - 0.3.13
        syncOptions:
        - CreateNamespace=true
    phase: Succeeded
    startedAt: "2024-11-20T14:07:18Z"
    syncResult:
      resources:
      - group: networking.k8s.io
        hookPhase: Succeeded
        kind: Ingress
        message: pruned
        name: workflow-docker-build
        namespace: devops-i
        status: Pruned
        syncPhase: Sync
        version: v1
      - group: ""
        hookPhase: Running
        kind: ServiceAccount
        message: serviceaccount/workflow-docker-build configured
        name: workflow-docker-build
        namespace: devops-i
        status: Synced
        syncPhase: Sync
        version: v1
      - group: ""
        hookPhase: Running
        kind: ConfigMap
        message: configmap/workflow-docker-build configured
        name: workflow-docker-build
        namespace: devops-i
        status: Synced
        syncPhase: Sync
        version: v1
      - group: ""
        hookPhase: Running
        kind: Service
        message: service/workflow-docker-build configured
        name: workflow-docker-build
        namespace: devops-i
        status: Synced
        syncPhase: Sync
        version: v1
      - group: apps
        hookPhase: Running
        kind: Deployment
        message: deployment.apps/workflow-docker-build configured
        name: workflow-docker-build
        namespace: devops-i
        status: Synced
        syncPhase: Sync
        version: v1
      - group: networking.k8s.io
        hookPhase: Running
        kind: Ingress
        message: ingress.networking.k8s.io/workflow-docker-build-internal created
        name: workflow-docker-build-internal
        namespace: devops-i
        status: Synced
        syncPhase: Sync
        version: v1
      revision: ""
      revisions:
      - 6cc24b59366c73dc87d20dfb3cf09982cc1040e8
      - 0.3.13
      source:
        repoURL: ""
      sources:
      - ref: values
        repoURL: https://github.com/company-DevOps/k8s-config-gts
        targetRevision: master
      - chart: company-generic-deployment
        helm:
          parameters:
          - name: group
            value: devops
          - name: environment
            value: integration
          - name: environmentShortSign
            value: i
          - name: nameOverride
            value: workflow-docker-build
          - name: k8sClusterName
            value: gts-p-us-east-1
          releaseName: workflow-docker-build
          valueFiles:
          - $values/devops/global.yaml
          - $values/devops/deployments/workflow-docker-build/global.yaml
          - $values/devops/deployments/workflow-docker-build/integration_us-east-1.yaml
        repoURL: ghcr.io/company-devops/helm-charts
        targetRevision: 0.x.x
  reconciledAt: "2024-11-21T14:57:55Z"
  resources:
  - kind: ConfigMap
    name: workflow-docker-build
    namespace: devops-i
    status: Synced
    version: v1
  - health:
      status: Healthy
    kind: Service
    name: workflow-docker-build
    namespace: devops-i
    status: Synced
    version: v1
  - kind: ServiceAccount
    name: workflow-docker-build
    namespace: devops-i
    status: Synced
    version: v1
  - group: apps
    health:
      status: Healthy
    kind: Deployment
    name: workflow-docker-build
    namespace: devops-i
    status: Synced
    version: v1
  - group: networking.k8s.io
    health:
      status: Healthy
    kind: Ingress
    name: workflow-docker-build-internal
    namespace: devops-i
    status: Synced
    version: v1
  sourceTypes:
  - ""
  - Helm
  summary:
    externalURLs:
    - http://devops-i-workflow-docker-build-us-east-1-k8s-internal.toolmx.com/
    - https://devops-i-workflow-docker-build-us-east-1-k8s-internal.toolmx.com
    images:
    - 339817570899.dkr.ecr.us-east-1.amazonaws.com/workflow-docker-build:0.14.0
  sync:
    comparedTo:
      destination:
        name: in-cluster
        namespace: devops-i
      source:
        repoURL: ""
      sources:
      - ref: values
        repoURL: https://github.com/company-DevOps/k8s-config-gts
        targetRevision: master
      - chart: company-generic-deployment
        helm:
          parameters:
          - name: group
            value: devops
          - name: environment
            value: integration
          - name: environmentShortSign
            value: i
          - name: nameOverride
            value: workflow-docker-build
          - name: k8sClusterName
            value: gts-p-us-east-1
          releaseName: workflow-docker-build
          valueFiles:
          - $values/devops/global.yaml
          - $values/devops/deployments/workflow-docker-build/global.yaml
          - $values/devops/deployments/workflow-docker-build/integration_us-east-1.yaml
        repoURL: ghcr.io/company-devops/helm-charts
        targetRevision: 0.x.x
    revisions:
    - 74e087e8133799cdb4826be63f9c50e867b74517
    - 0.3.13
    status: Synced
omerap12 commented 1 week ago

@omerap12 - I'm just adopting Argo CD Notifications in our Argo CD instance and researching the trigger definitions, and I came upon your issue here while searching issues. I notice that trigger.on-deployed in the notifications_catalog is slightly more elaborate than what you posted above:

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

Maybe one of the differences is crucial for the Argo CD you're running?

Thanks, but it didn't help.