The use case is that we think about triggering an Argo Workflow via Argo Events with PubSub. PubSub does not guarantee that a message is delivered only once. Is there an easy method to prevent a Workflow from being triggered again when it is running already?
Something like the concurrencyPolicy
setting for CronWorkflows.
To have something to look at - let's assume the whalesay Workflow:
apiVersion: argoproj.io/v1alpha1
kind: Workflow # new type of k8s spec
metadata:
name: hello-world # name of the workflow spec
namespace: argo
spec:
entrypoint: whalesay # invoke the whalesay template
templates:
- name: whalesay # name of the template
container:
image: docker/whalesay
command: [cowsay]
args: ["hello world"]
resources: # limit the resources
limits:
memory: 32Mi
cpu: 100m
I found the following two promising issues - but I fail to extract the solution for this problem.