Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Namespaced Scope Interceptor #1462

Merged
merged 3 commits into from
Nov 15, 2022
Merged

Add Namespaced Scope Interceptor #1462

merged 3 commits into from
Nov 15, 2022

Conversation

khrm
Copy link
Contributor

@khrm khrm commented Oct 12, 2022

Added Namespaced Scope Interceptor. A namespaced admin can create and manage its interceptor without requiring elevated permissions. Fixes #1364

Changes

Submitter Checklist

These are the criteria that every PR should meet, please check them off as you
review them:

  • Includes tests (if functionality changed/added)
  • Includes docs (if user facing)
  • Commit messages follow commit message best practices
  • Release notes block has been filled in or deleted (only if no user facing changes)

See the contribution guide for more details.

Release Notes

`Interceptor` CRD has been added which can be used to define NamespacedScope Interceptor. Use NamespacedInterceptor in kind section of Interceptors Ref in Triggers or EventListener spec.

@tekton-robot tekton-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Oct 12, 2022
@tekton-robot tekton-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Oct 12, 2022
Copy link
Contributor Author

@khrm khrm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/hold

@tekton-robot tekton-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 12, 2022
@tekton-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-tekton-triggers-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/triggers/v1alpha1/interceptor_defaults.go Do not exist N/A
pkg/apis/triggers/v1alpha1/interceptor_validation.go Do not exist 100.0%
pkg/apis/triggers/v1alpha1/ns_interceptor_types.go Do not exist 100.0%
pkg/reconciler/interceptor/controller.go Do not exist 0.0%
pkg/reconciler/interceptor/interceptor.go Do not exist 90.9%

@tekton-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-tekton-triggers-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/apis/triggers/v1alpha1/interceptor_defaults.go Do not exist N/A
pkg/apis/triggers/v1alpha1/interceptor_validation.go Do not exist 100.0%
pkg/apis/triggers/v1alpha1/ns_interceptor_types.go Do not exist 100.0%
pkg/reconciler/interceptor/controller.go Do not exist 0.0%
pkg/reconciler/interceptor/interceptor.go Do not exist 90.9%
pkg/sink/sink.go 73.1% 61.4% -11.7

@tekton-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-tekton-triggers-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/adapter/adapter.go 28.8% 23.5% -5.3
pkg/apis/triggers/v1alpha1/interceptor_defaults.go Do not exist N/A
pkg/apis/triggers/v1alpha1/interceptor_validation.go Do not exist 100.0%
pkg/apis/triggers/v1alpha1/ns_interceptor_types.go Do not exist 100.0%
pkg/reconciler/interceptor/controller.go Do not exist 0.0%
pkg/reconciler/interceptor/interceptor.go Do not exist 90.9%
pkg/sink/sink.go 73.1% 61.4% -11.7

@tekton-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-tekton-triggers-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/adapter/adapter.go 28.8% 23.5% -5.3
pkg/apis/triggers/v1alpha1/interceptor_defaults.go Do not exist N/A
pkg/apis/triggers/v1alpha1/interceptor_validation.go Do not exist 100.0%
pkg/apis/triggers/v1alpha1/ns_interceptor_types.go Do not exist 100.0%
pkg/reconciler/interceptor/controller.go Do not exist 0.0%
pkg/reconciler/interceptor/interceptor.go Do not exist 90.9%
pkg/sink/sink.go 73.1% 61.4% -11.7

@tekton-robot tekton-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Oct 12, 2022
@tekton-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-tekton-triggers-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/adapter/adapter.go 28.8% 23.5% -5.3
pkg/apis/triggers/v1alpha1/interceptor_defaults.go Do not exist 0.0%
pkg/apis/triggers/v1alpha1/interceptor_validation.go Do not exist 100.0%
pkg/apis/triggers/v1alpha1/ns_interceptor_types.go Do not exist 100.0%
pkg/reconciler/interceptor/controller.go Do not exist 0.0%
pkg/reconciler/interceptor/interceptor.go Do not exist 90.9%
pkg/sink/sink.go 73.1% 61.4% -11.7

@tekton-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-tekton-triggers-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/adapter/adapter.go 28.8% 23.5% -5.3
pkg/apis/triggers/v1alpha1/interceptor_defaults.go Do not exist 0.0%
pkg/apis/triggers/v1alpha1/interceptor_validation.go Do not exist 100.0%
pkg/apis/triggers/v1alpha1/ns_interceptor_types.go Do not exist 100.0%
pkg/reconciler/interceptor/controller.go Do not exist 0.0%
pkg/reconciler/interceptor/interceptor.go Do not exist 90.9%
pkg/sink/sink.go 73.1% 69.7% -3.4

@khrm
Copy link
Contributor Author

khrm commented Oct 13, 2022

/hold cancel

@tekton-robot tekton-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Oct 13, 2022
@tekton-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-tekton-triggers-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/adapter/adapter.go 28.8% 23.5% -5.3
pkg/apis/triggers/v1alpha1/interceptor_defaults.go Do not exist 0.0%
pkg/apis/triggers/v1alpha1/interceptor_validation.go Do not exist 100.0%
pkg/apis/triggers/v1alpha1/ns_interceptor_types.go Do not exist 100.0%
pkg/reconciler/interceptor/controller.go Do not exist 0.0%
pkg/reconciler/interceptor/interceptor.go Do not exist 90.9%
pkg/sink/sink.go 73.1% 72.0% -1.1
test/controller.go 71.8% 70.5% -1.3

@khrm
Copy link
Contributor Author

khrm commented Oct 13, 2022

/test pull-tekton-triggers-integration-tests

Copy link
Contributor Author

@khrm khrm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/kind feature

@tekton-robot tekton-robot added the kind/feature Categorizes issue or PR as related to a new feature. label Oct 13, 2022
@tekton-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-tekton-triggers-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/adapter/adapter.go 28.8% 23.5% -5.3
pkg/apis/triggers/v1alpha1/interceptor_defaults.go Do not exist 0.0%
pkg/apis/triggers/v1alpha1/interceptor_validation.go Do not exist 100.0%
pkg/apis/triggers/v1alpha1/ns_interceptor_types.go Do not exist 100.0%
pkg/reconciler/interceptor/controller.go Do not exist 0.0%
pkg/reconciler/interceptor/interceptor.go Do not exist 90.9%
pkg/sink/sink.go 73.1% 72.0% -1.1
test/controller.go 71.8% 70.5% -1.3

@tekton-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-tekton-triggers-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/adapter/adapter.go 28.8% 23.5% -5.3
pkg/apis/triggers/v1alpha1/interceptor_defaults.go Do not exist 0.0%
pkg/apis/triggers/v1alpha1/interceptor_validation.go Do not exist 100.0%
pkg/apis/triggers/v1alpha1/ns_interceptor_types.go Do not exist 100.0%
pkg/reconciler/interceptor/controller.go Do not exist 0.0%
pkg/reconciler/interceptor/interceptor.go Do not exist 90.9%
pkg/sink/sink.go 73.1% 72.0% -1.1
test/controller.go 71.8% 70.5% -1.3

@tekton-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-tekton-triggers-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/adapter/adapter.go 28.8% 23.5% -5.3
pkg/apis/triggers/v1alpha1/interceptor_defaults.go Do not exist 0.0%
pkg/apis/triggers/v1alpha1/interceptor_types.go 66.7% 90.9% 24.2
pkg/apis/triggers/v1alpha1/interceptor_validation.go Do not exist 100.0%
pkg/reconciler/interceptor/controller.go Do not exist 0.0%
pkg/reconciler/interceptor/interceptor.go Do not exist 90.9%
pkg/sink/sink.go 73.0% 72.0% -1.0
test/controller.go 71.8% 70.5% -1.3

Copy link
Member

@dibyom dibyom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code looks fine, but I think we should add examples and docs before the release

If a clusterinterceptor and interceptor have the same name, which one is used?

pkg/client/dynamic/clientset/tekton/tekton.go Show resolved Hide resolved
@tekton-robot tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 10, 2022
@khrm
Copy link
Contributor Author

khrm commented Nov 11, 2022

If a clusterinterceptor and interceptor have the same name, which one is used?

I didn't get this. Which place are you talking about? We specify InterceptorKind in the ref.

@dibyom
Copy link
Member

dibyom commented Nov 11, 2022

Is InterceptorKind a required field now? And does it default to ClusterInterceptor?

@khrm
Copy link
Contributor Author

khrm commented Nov 11, 2022

It's still optional. By default, it is ClusterInterceptor.

Added documentation. I will add examples soon.

@tekton-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-tekton-triggers-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/adapter/adapter.go 28.8% 23.5% -5.3
pkg/apis/triggers/v1alpha1/interceptor_defaults.go Do not exist 0.0%
pkg/apis/triggers/v1alpha1/interceptor_types.go 66.7% 90.9% 24.2
pkg/apis/triggers/v1alpha1/interceptor_validation.go Do not exist 100.0%
pkg/reconciler/interceptor/controller.go Do not exist 0.0%
pkg/reconciler/interceptor/interceptor.go Do not exist 90.9%
pkg/sink/sink.go 73.0% 72.0% -1.0
test/controller.go 71.8% 70.5% -1.3

@dibyom
Copy link
Member

dibyom commented Nov 11, 2022

It's still optional. By default, it is ClusterInterceptor.

got it, that makes sense!

@khrm
Copy link
Contributor Author

khrm commented Nov 11, 2022

I will add the example on Monday.

Copy link
Member

@dibyom dibyom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/approve

@tekton-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: dibyom

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@tekton-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-tekton-triggers-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/adapter/adapter.go 28.8% 23.5% -5.3
pkg/apis/triggers/v1alpha1/interceptor_defaults.go Do not exist 0.0%
pkg/apis/triggers/v1alpha1/interceptor_types.go 66.7% 90.9% 24.2
pkg/apis/triggers/v1alpha1/interceptor_validation.go Do not exist 100.0%
pkg/reconciler/interceptor/controller.go Do not exist 0.0%
pkg/reconciler/interceptor/interceptor.go Do not exist 90.9%
pkg/sink/sink.go 73.0% 72.0% -1.0
test/controller.go 71.8% 70.5% -1.3

khrm added 2 commits November 14, 2022 15:04
Added Namespaced Scope Interceptor. A namespaced admin can create and
manage its interceptor without requiring elevated permissions. Fixes #1364
@tekton-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-tekton-triggers-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/adapter/adapter.go 28.8% 23.5% -5.3
pkg/apis/triggers/v1alpha1/interceptor_defaults.go Do not exist 0.0%
pkg/apis/triggers/v1alpha1/interceptor_types.go 66.7% 90.9% 24.2
pkg/apis/triggers/v1alpha1/interceptor_validation.go Do not exist 100.0%
pkg/reconciler/interceptor/controller.go Do not exist 0.0%
pkg/reconciler/interceptor/interceptor.go Do not exist 90.9%
pkg/sink/sink.go 73.0% 72.0% -1.0
test/controller.go 71.8% 70.5% -1.3

@tekton-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-tekton-triggers-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/adapter/adapter.go 28.8% 23.5% -5.3
pkg/apis/triggers/v1alpha1/interceptor_defaults.go Do not exist 0.0%
pkg/apis/triggers/v1alpha1/interceptor_types.go 66.7% 90.9% 24.2
pkg/apis/triggers/v1alpha1/interceptor_validation.go Do not exist 100.0%
pkg/reconciler/interceptor/controller.go Do not exist 0.0%
pkg/reconciler/interceptor/interceptor.go Do not exist 90.9%
pkg/sink/sink.go 73.0% 72.0% -1.0
test/controller.go 71.8% 70.5% -1.3

@khrm
Copy link
Contributor Author

khrm commented Nov 14, 2022

@savitaashture I have added the example. Please review and add LGTM.

Example utilizes Core Interceptor from v0.19 Triggers.
@tekton-robot
Copy link

The following is the coverage report on the affected files.
Say /test pull-tekton-triggers-go-coverage to re-run this coverage report

File Old Coverage New Coverage Delta
pkg/adapter/adapter.go 28.8% 23.5% -5.3
pkg/apis/triggers/v1alpha1/interceptor_defaults.go Do not exist 0.0%
pkg/apis/triggers/v1alpha1/interceptor_types.go 66.7% 90.9% 24.2
pkg/apis/triggers/v1alpha1/interceptor_validation.go Do not exist 100.0%
pkg/reconciler/interceptor/controller.go Do not exist 0.0%
pkg/reconciler/interceptor/interceptor.go Do not exist 90.9%
pkg/sink/sink.go 73.0% 72.0% -1.0
test/controller.go 71.8% 70.5% -1.3

@savitaashture
Copy link
Contributor

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Nov 15, 2022
@tekton-robot tekton-robot merged commit b4a404d into main Nov 15, 2022
@khrm khrm deleted the f/NSInterceptor branch February 28, 2023 04:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Namespace scoped Interceptor
4 participants