I have an argo sensor that I want to trigger a workflow after receiving an event from event bus.
It triggers the sensor but the issue is that the workflow does not start
I am sending a post request from postman with a body containing the url
I want the workflow to get the url as a parameter and use it to perform a build it.
apiVersion: argoproj.io/v1alpha1
kind: Sensor
metadata:
name: webhook
namespace: argo-events
spec:
template:
serviceAccountName: operate-workflow-sa
dependencies:
- name: test-dep
eventSourceName: webhook
eventName: example
triggers:
- template:
name: webhook-workflow-trigger
k8s:
group: argoproj.io
version: v1alpha1
resource: workflows
operation: create
source:
resource:
apiVersion: argoproj.io/v1alpha1
kind: Workflow
metadata:
name: s3-react-upload
spec:
entrypoint: git-clone
arguments:
parameters:
- name: url
value: hello world
templates:
- name: git-clone
inputs:
artifacts:
- name: argo-source
path: /src
git:
repo: "{{inputs.parameters.url}}"
container:
image: node:16-alpine3.17
command: [sh, -c]
args: ["npm install && npm run build"]
workingDir: /src
outputs:
artifacts:
- name: message
path: /src/build
archive:
none: {}
s3:
endpoint: s3.amazonaws.com
bucket: ignite-react-app-2023
region: eu-west-2
key: "."
accessKeySecret:
name: mysecret
key: accessKey
secretKeySecret:
name: mysecret
key: secretKey
parameters:
- src:
dependencyName: test-dep
dataKey: body.key
dest: spec.arguments.parameters.0.value
JSON post request
{
"url": "https://github.com/noname/ci-cd"
}
webhook
apiVersion: argoproj.io/v1alpha1
kind: EventSource
metadata:
name: webhook
namespace: argo-events
spec:
service:
ports:
- port: 12000
targetPort: 12000
webhook:
example:
port: "12000"
endpoint: /example
method: POST
I am getting this error
Failed to execute a trigger","sensorName":"webhook","error":"unable to resolve 'test-dep' parameter value. err: <nil>","triggerName":"webhook-workflow-trigger","triggeredBy":["test-dep"],"triggeredByEvents":
any solutions