You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey, some unexpected behavior I encountered regarding the notification behavior:
The documentation example of using when: app.status.operationState.phase in ['Succeeded']
results in the errors attached in the screenshot (first lines) while the application is new and was just deployed without being synced (so guessing it has no operationState.phase). is this intended? am I supposed to add an != 'null'? if so, id be glad for a clarificiation and ill add it to the documentation as well, just expected it to integrate better with ArgoCD itself and avoid these errors since it is even part of the same repo.
Regarding the 2 DEBUG logs at bottom of the logs I sent, I configured a service, trigger, and template for a webhook to my custom internal k8s service, I configured it to be only POST (in the template) but for some reason it sends a GET request before the POST so there are actually 2 requests. is this intended? here is my configuration if this is needed:
To trigger the notification all im doing is deploying a basic Argo app (using argoproj's guestbook example in argocd-example-apps).
Note the != null I added is due to the aforementioned missing phase issue.
service.webhook.notify-success-test-api: |
url: http://http-echo.default.svc.cluster.local
headers:
- name: "Content-Type"
value: "application/json"
insecureSkipVerify: true
service.webhook.notify-fail-test-api: |
url: http://http-echo.default.svc.cluster.local
headers:
- name: "Content-Type"
value: "application/json"
insecureSkipVerify: true
trigger.on-first-deployed-app: |
- when: app.status.operationState != null and app.status.operationState.phase in ['Succeeded'] and app.status.health.status == 'Healthy' and app.status.sync.status == 'Synced'
oncePer: app.metadata.name
send: [notify-success-test-api]
description: A new app is synced and healthy.
- when: app.status.operationState != null and app.status.operationState.phase in ['Error', 'Failed'] or app.status.health.status != 'Healthy'
oncePer: app.metadata.name
send: [notify-fail-test-api]
description: A new app is failing.
template.notify-success-test-api: |
webhook:
notify-success-test-api:
method: POST
path: /test
body: |
{
"argocd_app_name": "{{`{{.app.metadata.name}}`}}",
"state": "success"
}
template.notify-fail-test-api: |
webhook:
notify-fail-test-api:
method: POST
path: /test
body: |
{
"argocd_app_name": "{{`{{.app.metadata.name}}`}}",
"state": "error"
}
Thanks in advance!
To Reproduce
See configuration above.
Expected behavior
No errors for a missing phase on a new app + only a POST request instead of a GET+POST.
Screenshots
Version
v2.10.6+d504d2b
Logs
time="2025-02-20T11:20:52Z" level=error msg="failed to execute when condition: cannot fetch phase from <nil> (1:27)\n | app.status.operationState.phase in ['Succeeded']"
time="2025-02-20T11:21:32Z" level=error msg="failed to execute when condition: cannot fetch phase from <nil> (1:27)\n | app.status.operationState.phase in ['Succeeded']"
time="2025-02-20T11:22:28Z" level=error msg="failed to execute when condition: cannot fetch phase from <nil> (1:27)\n | app.status.operationState.phase in ['Succeeded']"
2025/02/20 11:22:31 [DEBUG] GET http://http-echo.default.svc.cluster.local
2025/02/20 11:22:31 [DEBUG] POST http://http-echo.default.svc.cluster.local/test
The text was updated successfully, but these errors were encountered:
Checklist:
argocd version
.Describe the bug
Hey, some unexpected behavior I encountered regarding the notification behavior:
The documentation example of using
when: app.status.operationState.phase in ['Succeeded']
results in the errors attached in the screenshot (first lines) while the application is new and was just deployed without being synced (so guessing it has no
operationState.phase
). is this intended? am I supposed to add an!= 'null'
? if so, id be glad for a clarificiation and ill add it to the documentation as well, just expected it to integrate better with ArgoCD itself and avoid these errors since it is even part of the same repo.Regarding the 2 DEBUG logs at bottom of the logs I sent, I configured a service, trigger, and template for a webhook to my custom internal k8s service, I configured it to be only POST (in the template) but for some reason it sends a GET request before the POST so there are actually 2 requests. is this intended? here is my configuration if this is needed:
To trigger the notification all im doing is deploying a basic Argo app (using argoproj's guestbook example in argocd-example-apps).
Note the
!= null
I added is due to the aforementioned missing phase issue.Thanks in advance!
To Reproduce
See configuration above.
Expected behavior
No errors for a missing phase on a new app + only a POST request instead of a GET+POST.
Screenshots
Version
Logs
The text was updated successfully, but these errors were encountered: