You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

ArgoCD v2.4.15同步成功未触发通知,提示sync status out of date

ArgoCD v2.4.15通知配置异常:"Processing skipped: sync status out of date" 问题解决

问题描述

我在为ArgoCD v2.4.15配置通知时遇到异常:每当新提交完成同步并部署应用后,日志会输出:

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

我的argocd-notification ConfigMap配置如下:

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

触发器配置:

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'

问题原因

这个日志提示的核心是通知控制器检测到当前应用的同步状态已过期。在ArgoCD v2.4.15版本中,应用同步完成后operationState字段会被重置清空,导致触发器依赖的operationState.phase == 'Succeeded'条件无法匹配到有效状态,进而跳过通知处理。

修复步骤

1. 修改触发器判断条件

将触发器的when条件改为基于应用的同步状态和健康状态,不再依赖operationState:

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.sync.status == 'Synced' and app.status.health.status == 'Healthy'

2. 验证oncePer字段有效性

app.status.sync.revision字段在应用同步完成后会更新为最新的提交哈希,确保该字段能正确获取值,保证每个提交仅触发一次通知。

3. 同步调整通知模板(若涉及)

如果mattermost-app-deployed模板中引用了operationState相关字段,需要同步修改模板内容,避免因字段不存在导致通知发送失败。

4. 重启通知控制器

修改配置后,重启argocd-notifications-controller pod使配置生效:

kubectl rollout restart deployment argocd-notifications-controller -n argocd

内容的提问来源于stack exchange,提问作者wiktor

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.14 15:01:15