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

Migrate core interceptors to use InterceptorType CRD #976

Merged
merged 1 commit into from
Mar 18, 2021

Conversation

dibyom
Copy link
Member

@dibyom dibyom commented Feb 26, 2021

Changes

Migrate core interceptors to use InterceptorType CRD

This commit does the following:

  1. Add YAML definitions for installing each core interceptor using the
    new InterceptorType CRD.
  2. Modify the EventListener to use the InterceptorType CRD to find the
    Interceptor's URL.

Fixes #868

This is NOT a breaking change since users can still configure their interceptors in the same way was before. Changes to the way a TriggerInterceptor is configured is coming in #869.

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

Depends on #960

@tekton-robot tekton-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. release-note Denotes a PR that will be considered when it comes time to generate release notes. labels Feb 26, 2021
@tekton-robot tekton-robot added the size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. label Feb 26, 2021
@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/cluster_interceptor_defaults.go Do not exist 100.0%
pkg/apis/triggers/v1alpha1/cluster_interceptor_types.go Do not exist 100.0%
pkg/apis/triggers/v1alpha1/cluster_interceptor_validation.go Do not exist 100.0%
pkg/interceptors/interceptors.go 92.1% 91.6% -0.5
pkg/reconciler/v1alpha1/clusterinterceptor/clusterinterceptor.go Do not exist 90.9%
pkg/reconciler/v1alpha1/clusterinterceptor/controller.go Do not exist 0.0%
pkg/sink/sink.go 78.4% 77.1% -1.3
test/controller.go 73.1% 71.4% -1.7

@dibyom dibyom mentioned this pull request Feb 26, 2021
4 tasks
@tekton-robot tekton-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 3, 2021
@tekton-robot tekton-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 4, 2021
@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/cluster_interceptor_defaults.go Do not exist 100.0%
pkg/apis/triggers/v1alpha1/cluster_interceptor_types.go Do not exist 100.0%
pkg/apis/triggers/v1alpha1/cluster_interceptor_validation.go Do not exist 100.0%
pkg/interceptors/interceptors.go 92.1% 91.6% -0.5
pkg/reconciler/v1alpha1/clusterinterceptor/clusterinterceptor.go Do not exist 90.9%
pkg/reconciler/v1alpha1/clusterinterceptor/controller.go Do not exist 0.0%
pkg/sink/sink.go 78.4% 77.1% -1.3
test/controller.go 72.5% 71.1% -1.4

Base automatically changed from master to main March 10, 2021 15:03
@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/cluster_interceptor_defaults.go Do not exist 100.0%
pkg/apis/triggers/v1alpha1/cluster_interceptor_types.go Do not exist 100.0%
pkg/apis/triggers/v1alpha1/cluster_interceptor_validation.go Do not exist 100.0%
pkg/interceptors/interceptors.go 92.1% 91.6% -0.5
pkg/reconciler/v1alpha1/clusterinterceptor/clusterinterceptor.go Do not exist 90.9%
pkg/reconciler/v1alpha1/clusterinterceptor/controller.go Do not exist 0.0%
pkg/sink/sink.go 78.4% 77.1% -1.3
test/controller.go 72.5% 71.1% -1.4

@tekton-robot tekton-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Mar 11, 2021
@dibyom dibyom marked this pull request as ready for review March 11, 2021 17:17
@tekton-robot tekton-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 11, 2021
@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/cluster_interceptor_validation.go Do not exist 100.0%
pkg/interceptors/interceptors.go 92.1% 91.6% -0.5
pkg/reconciler/v1alpha1/clusterinterceptor/controller.go Do not exist 0.0%
pkg/sink/sink.go 78.4% 77.1% -1.3
test/controller.go 72.5% 71.1% -1.4

@dibyom
Copy link
Member Author

dibyom commented Mar 12, 2021

/assign @wlynch
/assign @savitaashture
/assign @khrm

@tekton-robot tekton-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 13, 2021
@tekton-robot tekton-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 15, 2021
@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/cluster_interceptor_validation.go Do not exist 100.0%
pkg/interceptors/interceptors.go 92.1% 91.6% -0.5
pkg/reconciler/v1alpha1/clusterinterceptor/controller.go Do not exist 0.0%
pkg/reconciler/v1alpha1/eventlistener/eventlistener.go 78.0% 79.7% 1.7
pkg/sink/sink.go 78.4% 77.1% -1.3
test/controller.go 72.5% 71.1% -1.4

@dibyom
Copy link
Member Author

dibyom commented Mar 16, 2021

/test pull-tekton-triggers-integration-tests

Copy link
Member

@bigkevmcd bigkevmcd left a comment

Choose a reason for hiding this comment

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

Some relatively minor mostly cosmetic issues, otherwise looks good to me.

pkg/interceptors/interceptors.go Outdated Show resolved Hide resolved
pkg/interceptors/interceptors_test.go Show resolved Hide resolved
pkg/reconciler/v1alpha1/clusterinterceptor/controller.go Outdated Show resolved Hide resolved
pkg/interceptors/interceptors_test.go Outdated Show resolved Hide resolved
pkg/interceptors/interceptors.go Outdated Show resolved Hide resolved
@tekton-robot tekton-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 16, 2021
@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/cluster_interceptor_validation.go Do not exist 100.0%
pkg/apis/triggers/v1alpha1/trigger_types.go Do not exist 100.0%
pkg/interceptors/interceptors.go 92.1% 90.8% -1.3
pkg/reconciler/v1alpha1/clusterinterceptor/controller.go Do not exist 0.0%
pkg/reconciler/v1alpha1/eventlistener/eventlistener.go 78.0% 79.7% 1.7
test/controller.go 72.5% 71.1% -1.4

This commit does the following:
1. Add YAML definitions for installing each core interceptor using the
new InterceptorType CRD.
2. Modify the EventListener to use the InterceptorType CRD to find the
Interceptor's URL.

Fixes tektoncd#868

Signed-off-by: Dibyo Mukherjee <dibyo@google.com>
@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/cluster_interceptor_validation.go Do not exist 100.0%
pkg/apis/triggers/v1alpha1/trigger_types.go Do not exist 100.0%
pkg/interceptors/interceptors.go 92.1% 90.8% -1.3
pkg/reconciler/v1alpha1/clusterinterceptor/controller.go Do not exist 0.0%
pkg/reconciler/v1alpha1/eventlistener/eventlistener.go 78.0% 79.7% 1.7
pkg/sink/sink.go 78.4% 77.1% -1.3
test/controller.go 72.5% 71.1% -1.4

Copy link
Contributor

@savitaashture savitaashture left a comment

Choose a reason for hiding this comment

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

/lgtm

Verified locally it works as expected
Thank you 👍

Just one question if user want to write custom interceptor what all things they have to take care? do we have any steps/instructions?

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Mar 17, 2021
@dibyom
Copy link
Member Author

dibyom commented Mar 17, 2021

Just one question if user want to write custom interceptor what all things they have to take care? do we have any steps/instructions?

Docs coming for those as part of #1001

@tekton-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: savitaashture

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 tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 18, 2021
@tekton-robot tekton-robot merged commit 02c3896 into tektoncd:main Mar 18, 2021
@dibyom dibyom deleted the coreinter branch March 18, 2021 17:00
dibyom added a commit to dibyom/triggers that referenced this pull request Mar 18, 2021
With tektoncd#976, core interceptors are now installed as instances of the
ClusterInterceptor CRD. They are also bundled in a separate YAML file. We need
to wait for the Interceptors CRD to become established before we can create the
core interceptors. Otherwise, we run the risk of trying to create the
core-interceptors too early leading to installation errors. In tektoncd#976 we fixed
the e2e install scripts to account for these changes but not the release
pipeline. This commit updates the release pipeline to add the new interceptors
YAML as part of the release assets.

Signed-off-by: Dibyo Mukherjee <dibyo@google.com>
dibyom added a commit to dibyom/triggers that referenced this pull request Mar 18, 2021
With tektoncd#976, core interceptors are now installed as instances of the
ClusterInterceptor CRD. They are also bundled in a separate YAML file. We need
to wait for the Interceptors CRD to become established before we can create the
core interceptors. Otherwise, we run the risk of trying to create the
core-interceptors too early leading to installation errors. In tektoncd#976 we fixed
the e2e install scripts to account for these changes but not the release
pipeline. This commit updates the release pipeline to add the new interceptors
YAML as part of the release assets.

Fixes tektoncd#1006

Signed-off-by: Dibyo Mukherjee <dibyo@google.com>
tekton-robot pushed a commit that referenced this pull request Mar 24, 2021
With #976, core interceptors are now installed as instances of the
ClusterInterceptor CRD. They are also bundled in a separate YAML file. We need
to wait for the Interceptors CRD to become established before we can create the
core interceptors. Otherwise, we run the risk of trying to create the
core-interceptors too early leading to installation errors. In #976 we fixed
the e2e install scripts to account for these changes but not the release
pipeline. This commit updates the release pipeline to add the new interceptors
YAML as part of the release assets.

Fixes #1006

Signed-off-by: Dibyo Mukherjee <dibyo@google.com>
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. 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/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Interceptors: Implement CRD to provide a single way to install Interceptors
6 participants