Open omerap12 opened 2 months 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.
@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?
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 inoncePer
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 - 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.
Checklist:
argocd version
.Describe the bug
To Reproduce Set the following notitication config map:
And have an application which manages applications sets in a mono repo:
This is an example of application-set which the master-application managed:
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:
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
Logs