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 TriggerCRD object Ref to ELSpec Trigger #726

Merged
merged 2 commits into from
Sep 8, 2020

Conversation

khrm
Copy link
Contributor

@khrm khrm commented Aug 25, 2020

Changes

Support for adding Trigger CR Object as Ref to EventListenerSpec

Submitter Checklist

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

See the contribution guide for more details.

Release Notes

Now, Trigger CRD object can be used to just specify trigger inside the EventListener using `triggerRef`

@tekton-robot tekton-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 25, 2020
@tekton-robot tekton-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Aug 25, 2020
@tekton-robot tekton-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Aug 25, 2020
@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
test/builder/eventlistener.go 78.8% 76.8% -1.9
test/controller.go 73.0% 70.9% -2.0

@khrm khrm force-pushed the triggerRef branch 2 times, most recently from 7e997ae to 03b9f10 Compare August 25, 2020 09:24
@khrm khrm changed the title WIP Add TriggerCRD object Ref to ELSpec Trigger Add TriggerCRD object Ref to ELSpec Trigger Aug 25, 2020
@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 Aug 25, 2020
@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/sink/sink.go 78.6% 76.9% -1.7
test/builder/eventlistener.go 78.8% 76.8% -1.9
test/controller.go 73.0% 70.9% -2.0

@khrm khrm changed the title Add TriggerCRD object Ref to ELSpec Trigger WIP: Add TriggerCRD object Ref to ELSpec Trigger Aug 25, 2020
@tekton-robot tekton-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 25, 2020
@khrm khrm force-pushed the triggerRef branch 2 times, most recently from d037aa4 to 75e7569 Compare August 25, 2020 09:54
@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/sink/sink.go 78.6% 76.9% -1.7
test/builder/eventlistener.go 78.8% 76.8% -1.9
test/controller.go 73.0% 70.9% -2.0

@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/event_listener_validation.go 93.4% 92.2% -1.3
pkg/sink/sink.go 78.6% 76.9% -1.7
test/builder/eventlistener.go 78.8% 76.8% -1.9
test/controller.go 73.0% 70.9% -2.0

@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/event_listener_validation.go 93.4% 92.2% -1.3
pkg/sink/sink.go 78.6% 76.9% -1.7
test/builder/eventlistener.go 78.8% 76.8% -1.9
test/controller.go 73.0% 70.9% -2.0

@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/event_listener_validation.go 93.4% 92.2% -1.3
pkg/sink/sink.go 78.6% 76.9% -1.7
test/builder/eventlistener.go 78.8% 76.8% -1.9
test/controller.go 73.0% 70.9% -2.0

@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/event_listener_validation.go 93.4% 92.2% -1.3
pkg/sink/sink.go 78.6% 76.9% -1.7
test/builder/eventlistener.go 78.8% 76.8% -1.9
test/controller.go 73.0% 70.9% -2.0

@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/event_listener_validation.go 93.4% 92.2% -1.3
pkg/sink/sink.go 78.6% 76.9% -1.7
test/builder/eventlistener.go 78.8% 76.8% -1.9
test/controller.go 73.0% 70.9% -2.0

@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/event_listener_validation.go 93.4% 93.8% 0.3
pkg/sink/sink.go 78.6% 76.9% -1.7
test/builder/eventlistener.go 78.8% 79.3% 0.5
test/controller.go 73.0% 73.0% -0.0

@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 Sep 2, 2020
@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/event_listener_validation.go 93.4% 93.8% 0.3
pkg/sink/sink.go 78.6% 76.9% -1.7
test/builder/eventlistener.go 78.8% 79.3% 0.5
test/controller.go 73.0% 73.0% -0.0

@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/event_listener_validation.go 93.4% 93.8% 0.3
pkg/sink/sink.go 78.6% 76.9% -1.7
test/builder/eventlistener.go 78.8% 79.3% 0.5
test/controller.go 73.0% 73.0% -0.0

@tekton-robot tekton-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Sep 2, 2020
@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/event_listener_validation.go 93.4% 93.8% 0.3
pkg/sink/sink.go 78.6% 76.9% -1.7
test/builder/eventlistener.go 78.8% 79.3% 0.5
test/controller.go 73.0% 73.0% -0.0

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.

Looking good -- just some minor comments about the number of yaml files for the example and one question on string vs *string.

@@ -0,0 +1,11 @@
apiVersion: rbac.authorization.k8s.io/v1
Copy link
Member

Choose a reason for hiding this comment

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

minor: I know we have not been very consistent with the RBAC resources in our examples. Could we either symlink to the resources in the role-resources/ folder or at least move binding.yaml, role.yaml, serviceaccount.yaml into a single file (say, rbac.yaml?)

Copy link
Member

Choose a reason for hiding this comment

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

the idea being -- the fewer yaml files needed to get started with an example, the easier it is for a first time easier to understand -- ideally, one day we can do something like the pipeline examples where each example contains a single file containing a taskRun with an embedded taskSpec.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added everything related to rbac in a single file.

Template EventListenerTemplate `json:"template"`
Bindings []*EventListenerBinding `json:"bindings,omitempty"`
Template *EventListenerTemplate `json:"template,omitempty"`
TriggerRef string `json:"triggerRef,omitempty"`
Copy link
Member

Choose a reason for hiding this comment

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

should be use *string here since TriggerRef is optional?

Copy link
Contributor Author

@khrm khrm Sep 7, 2020

Choose a reason for hiding this comment

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

No, it's not necessary. Empty string or not giving anything is invalid, so we are good with this. The empty string will be considered as omitempty while using go client. An empty string or not giving anything will be considered omitempty while using json.

@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 tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 3, 2020
Support for adding Trigger CR Object as Ref to EventListenerSpec.
@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/event_listener_validation.go 93.4% 93.8% 0.3
pkg/sink/sink.go 78.6% 76.9% -1.7
test/builder/eventlistener.go 78.8% 79.3% 0.5
test/controller.go 73.0% 73.0% -0.0

Example eventlistener-triggerref and trigger created. Also,
added documentation of Trigger and information in Eventlistener
for refering to Trigger.
@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 Sep 7, 2020
@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/event_listener_validation.go 93.4% 93.8% 0.3
pkg/sink/sink.go 78.6% 76.9% -1.7
test/builder/eventlistener.go 78.8% 79.3% 0.5
test/controller.go 73.0% 73.0% -0.0

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

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Sep 8, 2020
@tekton-robot tekton-robot merged commit 45daf11 into tektoncd:master Sep 8, 2020
@khrm khrm added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label Sep 8, 2020
@khrm khrm deleted the triggerRef branch July 28, 2021 14: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/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.

None yet

4 participants