argo-workflows
argo-workflows copied to clipboard
workflowStopped event enhancement
Both successful workflows and stopped workflows are generating similar kind of events with 'reason' as 'WorkflowSucceeded'. There is no way to differentiate successful vs stopped events to trigger different down streams based on the status.
What change needs making? Would like to see reason as 'workflowStopped' for stopped workflows.
Use Cases
We are using Argo events architecture. We are using K8s Resource eventsource, relying on these k8 events to trigger downstreams. Since we are relying on 'WorkflowSucceeded' , it is matching events for both successful and stopped workflows.
Message from the maintainers:
Love this enhancement proposal? Give it a 👍. We prioritise the proposals with the most 👍.
Can you please clarify what you mean by "workflow stopped"? Do you mean you ran "argo stop my-wf"?
Yes, but through the API call /api/v1/workflows/{namespace}/{my-wf}/stop
Note that I am viewing this information on the UI's 'message' field
I was not able to replicate this issue. I get "workflow shutdown with strategy: Stop". This corresponds to https://github.com/argoproj/argo-workflows/blob/95cd467c7e75c38548bf42a5f3c940ac61568e4b/workflow/controller/workflowpod.go#L145
~~Are workflows currently being executed, capable of being "stopped"? if so this may be why I was unable to replicate this issue.~~
Update: Error (exit code 137) is the error message when you "stop" a running workflow.
This is the workflow I ran if that is of importance
metadata:
name: omniscient-bear
namespace: argo
labels:
example: 'true'
spec:
entrypoint: argosay
templates:
- name: argosay
container:
name: main
image: ubuntu:20.04
command:
- yes
ttlStrategy:
secondsAfterCompletion: 300
podGC:
strategy: OnPodCompletion
This information is based on the master as of 25/1/2022, commit 95cd467c7e75c38548bf42a5f3c940ac61568e4b
@isubasinghe @uday-mandava please make sure you do NOT use Kubernetes events for any automation, they are not reliable:
https://blog.argoproj.io/maybe-dont-use-kubernetes-events-for-automation-53951bdfd602
Hello can I work on this issue? I can't however see WorkflowSucceeded succeeded phase when I stop a workflow through the API call /api/v1/workflows/{namespace}/{my-wf}/stop. Instead I'm getting to see WorkflowFailed phase.