website
website copied to clipboard
Configuring Interceptors
Expected Behavior
That I could copy and modify the example interceptor and use it in OpenShift 4.9
Actual Behavior
I get a validation error on the following resource:
apiVersion: triggers.tekton.dev/v1alpha1
kind: EventListener
metadata:
name: clms-frontend-pipeline-webhook-listener
namespace: clms-devops
spec:
namespaceSelector: {}
resources: {}
serviceAccountName: pipeline
triggers:
- name: cel-trig
interceptors:
- ref:
name: cel
params:
- name: "overlays"
value:
- key: branch_name
expression: "body.ref.split('/')[2]"
- bindings:
- kind: TriggerBinding
ref: gitea-trigger-bindings
name: gitea-webhook-trigger
template:
ref: example
The error looks like:
admission webhook "validation.webhook.triggers.tekton.dev" denied the request: validation failed: expected exactly one, got neither: spec.triggers[0].template, spec.triggers[0].triggerRef
Steps to Reproduce the Problem
- Attempt to create the EventListener described above
Additional Info
Thanks for reporting @InfoSec812. /cc @tektoncd/triggers-maintainers
The indentation seems off.... there is an extra -
in front of bindings
. Could you point to the example this was copied from?
So, I found the examples from the Triggers repo and it seems that interceptors
don't live in isolation, they need to be in the same block as a binding. That was not clear from the documentation. Once I removed the hyphen in front of bindings
and put it at the same level as interceptors
it all started working.
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale
with a justification.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close
with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen
with a justification.
/lifecycle stale
Send feedback to tektoncd/plumbing.
/remove-lifecycle stale
The documentation is still in error and can be improved.
/assign @binkkatal
@afrittoli: GitHub didn't allow me to assign the following users: binkkatal.
Note that only tektoncd members, repo collaborators and people who have commented on this issue/PR can be assigned. Additionally, issues/PRs can only have 10 assignees at the same time. For more information please see the contributor guide
In response to this:
/assign @binkkatal
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.
@afrittoli can you please assign me this
/assign @binkkatal
@InfoSec812 , can you help me with the page link where this example was picked up from. i am unable to find them in the interceptor section
It looks like someone has since changed the example to show that interceptors and bindings are put together: https://tekton.dev/docs/triggers/triggerbindings/#accessing-data-added-by-interceptorsdocstriggersinterceptors
From my perspective, it would still be helpful to call out that Interceptors work with bindings and cannot be used without one.
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale
with a justification.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close
with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen
with a justification.
/lifecycle stale
Send feedback to tektoncd/plumbing.
Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten
with a justification.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close
with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen
with a justification.
/lifecycle rotten
Send feedback to tektoncd/plumbing.
/remove-lifecycle rotten /remove-lifecycle stale
Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale
with a justification.
Stale issues rot after an additional 30d of inactivity and eventually close.
If this issue is safe to close now please do so with /close
with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen
with a justification.
/lifecycle stale
Send feedback to tektoncd/plumbing.
Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten
with a justification.
Rotten issues close after an additional 30d of inactivity.
If this issue is safe to close now please do so with /close
with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen
with a justification.
/lifecycle rotten
Send feedback to tektoncd/plumbing.
Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen
with a justification.
Mark the issue as fresh with /remove-lifecycle rotten
with a justification.
If this issue should be exempted, mark the issue as frozen with /lifecycle frozen
with a justification.
/close
Send feedback to tektoncd/plumbing.
@tekton-robot: Closing this issue.
In response to this:
Rotten issues close after 30d of inactivity. Reopen the issue with
/reopen
with a justification. Mark the issue as fresh with/remove-lifecycle rotten
with a justification. If this issue should be exempted, mark the issue as frozen with/lifecycle frozen
with a justification./close
Send feedback to tektoncd/plumbing.
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.