website icon indicating copy to clipboard operation
website copied to clipboard

Configuring Interceptors

Open InfoSec812 opened this issue 3 years ago • 14 comments

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:

image

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

  1. Attempt to create the EventListener described above

Additional Info

InfoSec812 avatar Jan 18 '22 13:01 InfoSec812

Thanks for reporting @InfoSec812. /cc @tektoncd/triggers-maintainers

AlanGreene avatar Jan 18 '22 13:01 AlanGreene

The indentation seems off.... there is an extra - in front of bindings. Could you point to the example this was copied from?

dibyom avatar Jan 18 '22 20:01 dibyom

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.

InfoSec812 avatar Jan 18 '22 20:01 InfoSec812

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.

tekton-robot avatar Apr 18 '22 20:04 tekton-robot

/remove-lifecycle stale

The documentation is still in error and can be improved.

InfoSec812 avatar Apr 19 '22 14:04 InfoSec812

/assign @binkkatal

afrittoli avatar May 03 '22 17:05 afrittoli

@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.

tekton-robot avatar May 03 '22 17:05 tekton-robot

@afrittoli can you please assign me this

binkkatal avatar May 03 '22 17:05 binkkatal

/assign @binkkatal

binkkatal avatar May 03 '22 17:05 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

binkkatal avatar Jun 15 '22 01:06 binkkatal

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.

InfoSec812 avatar Jun 15 '22 10:06 InfoSec812

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.

tekton-robot avatar Sep 13 '22 11:09 tekton-robot

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.

tekton-robot avatar Oct 13 '22 11:10 tekton-robot

/remove-lifecycle rotten /remove-lifecycle stale

InfoSec812 avatar Oct 13 '22 11:10 InfoSec812

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.

tekton-robot avatar Jan 11 '23 12:01 tekton-robot

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.

tekton-robot avatar Feb 10 '23 12:02 tekton-robot

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 avatar Mar 12 '23 12:03 tekton-robot

@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.

tekton-robot avatar Mar 12 '23 12:03 tekton-robot