Interceptors: Library to make it easier to author interceptors
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
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.
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.
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.
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.
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
/reopenwith a justification. Mark the issue as fresh with/remove-lifecycle rottenwith a justification. If this issue should be exempted, mark the issue as frozen with/lifecycle frozenwith 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.