cel eval is not validating json already validated
Expected Behavior
cel-eval -e expressiont.txt -r payload.json: true or false
Actual Behavior
error making eval context: failed to parse the body as JSON: unexpected end of JSON input
body.object_kind == 'push' && (body.ref == 'refs/heads/develop' || body.ref == 'refs/heads/staging') or object_kind == 'push' && (ref == 'refs/heads/develop'
payload file:
POST / HTTP/1.1
Content-Type: application/json
User-Agent: insomnia/9.3.2
X-Gitlab-Event: Push Hook
X-Gitlab-Token: nononono
Host: localhost:8080
Content-Length: 4373
{
"object_kind": "push",
"event_name": "push",
"before": "36988bdb67e6fc4df847c37c4b040823ffa401d8",
"after": "143f0123a00e035a850b9f991a0214b5844b9e24",
"ref": "refs/heads/develop",
<... bla bla bla validated>
}
Steps to Reproduce the Problem
- get webhook payload from gitlab
- validate paylod in insomnia or json lint at https://jsonlint.com/
- not filtering!
- error making eval context: failed to parse the body as JSON: unexpected end of JSON input (???)
Additional Info
-
Kubernetes version:
Output of
kubectl version:(paste your output here) -
Tekton Pipeline version:
Output of
tkn versionorkubectl get pods -n tekton-pipelines -l app=tekton-pipelines-controller -o=jsonpath='{.items[0].metadata.labels.version}'
@alansenairj Are you changing the body from the original, if so, your Content-Length might be wrong which would cause the HTTP request reader to fail to parse the payload.