fix: On deployed trigger must consider race between last transition time and sync finished time (#9070) (#21944)

Signed-off-by: Andrii Korotkov <[email protected]>
This commit is contained in:
Andrii Korotkov
2025-02-23 17:44:24 +02:00
committed by GitHub
parent 10a163860a
commit 2e5dba2ccb
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -491,7 +491,8 @@ data:
send:
- app-deployed
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))
and app.status.health.status == 'Healthy' and !time.Parse(app.status.health.lastTransitionTime).Add(1
* time.Minute).Before(time.Parse(app.status.operationState.finishedAt))
trigger.on-health-degraded: |
- description: Application has degraded
oncePer: app.status.operationState?.syncResult?.revision
@@ -1,4 +1,4 @@
- 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))
- 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).Add(1 * time.Minute).Before(time.Parse(app.status.operationState.finishedAt))
description: Application is synced and healthy. Triggered once per commit.
send: [app-deployed]
oncePer: app.status.operationState?.syncResult?.revision