From a38a968043f43bcdd9aa377f39f111927aed5332 Mon Sep 17 00:00:00 2001 From: Siddhesh Ghadi Date: Mon, 30 Dec 2024 11:47:30 +0530 Subject: [PATCH] Stabilize on-deployed notification trigger Signed-off-by: Siddhesh Ghadi --- controllers/argocd/notifications_util.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/controllers/argocd/notifications_util.go b/controllers/argocd/notifications_util.go index 7fb753f98..ab8dec9e8 100644 --- a/controllers/argocd/notifications_util.go +++ b/controllers/argocd/notifications_util.go @@ -526,8 +526,8 @@ func getDefaultNotificationsTriggers() map[string]string { oncePer: app.status.operationState.syncResult.revision send: - app-deployed - when: app.status.operationState.phase in ['Succeeded'] and app.status.health.status - == 'Healthy'` + when: app.status.operationState != nil and app.status.operationState.phase in ['Succeeded'] and app.status.health.status + == 'Healthy' and !time.Parse(app.status.health.lastTransitionTime).Before(time.Parse(app.status.operationState.finishedAt))` notificationsTriggers["trigger.on-health-degraded"] = `- description: Application has degraded send: