triggers icon indicating copy to clipboard operation
triggers copied to clipboard

Interceptors: Library to make it easier to author interceptors

Open dibyom opened this issue 5 years ago • 4 comments

Feature request

We should make it easy to do common things for Interceptor authors in Go so that they can just focus on writing business logic (similar to knative/pkg/webhook)

Some functionality that this library can have

  • Setting up web server with sensible defaults (users only implement a handler)
  • Helper functions to convert errors to InterceptorResponse.Statuses (e.g. https://pkg.go.dev/google.golang.org/grpc/status#FromError)
  • (in the future) auto TLS support using something like Knative pkg's certificates controller
  • (in the future) openAPI validation for Interceptor params or config

dibyom avatar Apr 02 '21 20:04 dibyom

I have created an initial implementation of this: https://github.com/jmcshane/interceptor-sdk

Its not exactly in line with the knative webhook package linked above, but it does add a couple necessary pieces:

  • Generate ClusterInterceptor CRD
  • Provide ko build config/ directory

I think this may be a starting point to break into two pieces. The first piece is a library that can be referenced for things like the server.go and the entrypoint (probably lives in triggers repo directory), but then there's a starter repository for creating new ones (this would be a new repository). Feel free to poke around at the implementation and let me know how/where this may be appropriate to bring into tekton as well as any other feedback.

I do have a fully worked example here, if you follow the README Getting-Started section, you should be able to get the custom interceptor deployed into your cluster and referenced via a trigger.

jmcshane avatar Apr 10 '21 03:04 jmcshane

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 Jul 09 '21 04:07 tekton-robot

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 Oct 26 '21 15:10 tekton-robot

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 Aug 09 '22 15:08 tekton-robot

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 Dec 01 '22 16:12 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 Dec 31 '22 16:12 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 Jan 30 '23 16:01 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 Jan 30 '23 16:01 tekton-robot