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 tolerations to eventlistener #597

Merged

Conversation

GwonsooLee
Copy link

@GwonsooLee GwonsooLee commented Jun 5, 2020

Changes

Add tolerations to eventlistener. This is needed when I want to make event listener to the tainted node.

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

If all nodes are tainted for security and management issue, it is not possible to deploy event listener. (Of course.. it is possible to deploy by getting yaml file and modifying it, but then I have to keep two different files to manage)

If this feature is added, then user could add `tolerations` in EventListener crd, and deployments will be deployed with the same configuration.

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jun 5, 2020

CLA Check
The committers are authorized under a signed CLA.

@tekton-robot tekton-robot requested review from dibyom and dlorenc June 5, 2020 18:36
@tekton-robot tekton-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 5, 2020
@tekton-robot
Copy link

Hi @GwonsooLee. Thanks for your PR.

I'm waiting for a tektoncd member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@GwonsooLee
Copy link
Author

/assign @vtereso

@dibyom
Copy link
Member

dibyom commented Jun 5, 2020

Hi, @GwonsooLee Thanks for the PR! This looks related to #505

Could you add a podTemplate field to the EventListener that contains this tolerations field instead of directly adding the tolerations field in the EventListner spec?

@GwonsooLee
Copy link
Author

@dibyom Thanks for review. I added podTemplate to eventlistener and move the tolerations to it. In #505 , there are lots of things we could add to podTemplate, but this time I would like to add only tolerations feature because I still need time to deep dive into the code for better understanding :). I will try to add new features in podTemplate later. Please let me know if something's wrong wtih this PR.

@dibyom
Copy link
Member

dibyom commented Jun 9, 2020

/ok-to-test

@tekton-robot tekton-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jun 9, 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/reconciler/v1alpha1/eventlistener/eventlistener.go 69.9% 70.5% 0.5
test/builder/eventlistener.go 92.8% 83.1% -9.6

@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/reconciler/v1alpha1/eventlistener/eventlistener.go 69.9% 70.5% 0.5
test/builder/eventlistener.go 92.8% 83.1% -9.6

@@ -5,6 +5,12 @@ metadata:
name: listener
spec:
serviceAccountName: tekton-triggers-example-sa
# podTemplate:
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a separate example of eventlistener with tolerations

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.

Thanks @GwonsooLee In addition to an example like @khrm mentioned, could we add some docs to this as well :
https://github.com/tektoncd/triggers/blob/master/docs/eventlisteners.md#syntax

Also, before we can merge we'd have to squash the commits!

go.mod Outdated
@@ -13,7 +13,9 @@ require (
github.com/google/go-github/v31 v31.0.0
github.com/gorilla/mux v1.7.3
github.com/grpc-ecosystem/grpc-gateway v1.13.0 // indirect
github.com/onsi/ginkgo v1.10.2 // indirect
Copy link
Member

Choose a reason for hiding this comment

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

hmm...any idea why this got added 🤔 ?

Copy link
Author

Choose a reason for hiding this comment

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

I think it was added indirectly when I ran dependency script. I ran e2e test without it and it worked so that I removed it.

bldr.EventListenerPodTemplate(
bldr.EventListenerPodTemplateSpec(
bldr.EventListenerPodTemplateTolerations(nil),
// If you want to test toleration feature, please use this commented part.
Copy link
Member

Choose a reason for hiding this comment

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

Is the test commented out because it will fail in our CI runs?

Copy link
Author

Choose a reason for hiding this comment

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

No.. it worked even though I uncommented it. I commented out those lines because I think test process cannot verify it really works because I guess there is no tainted node for e2e test. I uncommented every lines about tolerations in test files.

bldr.EventListenerPodTemplate(
bldr.EventListenerPodTemplateSpec(
bldr.EventListenerPodTemplateTolerations(nil),
// If you want to test toleration feature, please use this commented part.
Copy link
Member

Choose a reason for hiding this comment

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

Same question as above...is this failing in CI? If it is and it is really hard to test this on our current e2e setup, we can open an issue for it. But I think I'd prefer not having commented out bits of code

Copy link
Author

Choose a reason for hiding this comment

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

I left comment above! 👍

@GwonsooLee GwonsooLee force-pushed the tolerations_in_eventlistener branch from 57a3c9d to 64771af Compare June 12, 2020 00:38
@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/reconciler/v1alpha1/eventlistener/eventlistener.go 69.9% 70.5% 0.5
test/builder/eventlistener.go 92.8% 83.1% -9.6

@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/reconciler/v1alpha1/eventlistener/eventlistener.go 69.9% 70.5% 0.5
test/builder/eventlistener.go 92.8% 83.1% -9.6

@GwonsooLee
Copy link
Author

/test all

@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/reconciler/v1alpha1/eventlistener/eventlistener.go 69.9% 70.5% 0.5
test/builder/eventlistener.go 92.8% 83.1% -9.6

@GwonsooLee GwonsooLee force-pushed the tolerations_in_eventlistener branch from 64771af to 52a4cb6 Compare June 12, 2020 00:57
@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/reconciler/v1alpha1/eventlistener/eventlistener.go 69.9% 70.5% 0.5
test/builder/eventlistener.go 92.8% 83.1% -9.6

@dibyom
Copy link
Member

dibyom commented Jun 15, 2020

/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 tekton-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 15, 2020
@dibyom
Copy link
Member

dibyom commented Jun 16, 2020

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 16, 2020
@dibyom
Copy link
Member

dibyom commented Jun 16, 2020

Just needs a rebase to resolve the go.mod conflicts

@dibyom dibyom added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 16, 2020
@GwonsooLee GwonsooLee force-pushed the tolerations_in_eventlistener branch from 52a4cb6 to d94724c Compare June 18, 2020 13:16
@tekton-robot tekton-robot removed the lgtm Indicates that a PR is ready to be merged. label Jun 18, 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/reconciler/v1alpha1/eventlistener/eventlistener.go 69.9% 70.5% 0.5
test/builder/eventlistener.go 92.8% 83.1% -9.6

@GwonsooLee GwonsooLee force-pushed the tolerations_in_eventlistener branch from d94724c to 98375b8 Compare June 18, 2020 13:20
@GwonsooLee GwonsooLee force-pushed the tolerations_in_eventlistener branch from 98375b8 to 41d4fdd Compare June 18, 2020 13:21
@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/reconciler/v1alpha1/eventlistener/eventlistener.go 69.9% 70.5% 0.5
test/builder/eventlistener.go 92.8% 83.1% -9.6

@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/reconciler/v1alpha1/eventlistener/eventlistener.go 69.9% 70.5% 0.5
test/builder/eventlistener.go 92.8% 83.1% -9.6

@GwonsooLee
Copy link
Author

/test pull-tekton-triggers-build-tests

@GwonsooLee
Copy link
Author

I rebase master and I ran though e2e test.. but build test failed.. @dibyom, could you please let me know what I've been doing wrong..? I will try to figure out too! Thanks you in advance..

@dibyom
Copy link
Member

dibyom commented Jun 18, 2020

The problem is :

pkg/resources/create.go:47:8: G601: Implicit memory aliasing in for loop. (gosec)
		r := &apiResource
		     ^

Its strange that this popped up in this PR given that this line was not touched 🤔

@dibyom
Copy link
Member

dibyom commented Jun 18, 2020

Running gosec locally does not fail with this problem either 😕

@dibyom
Copy link
Member

dibyom commented Jun 18, 2020

/test pull-tekton-triggers-build-tests

@dibyom
Copy link
Member

dibyom commented Jun 18, 2020

Should be fixed by https://github.com/tektoncd/triggers/pull/620/files

@dibyom
Copy link
Member

dibyom commented Jun 18, 2020

/test pull-tekton-triggers-build-tests

@GwonsooLee
Copy link
Author

It seems a bug in gosec. Thank you so much for fixing this problem! 👍

@dibyom dibyom removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 19, 2020
@dibyom
Copy link
Member

dibyom commented Jun 19, 2020

/lgtm

@tekton-robot tekton-robot added the lgtm Indicates that a PR is ready to be merged. label Jun 19, 2020
@GwonsooLee
Copy link
Author

/test pull-tekton-triggers-integration-tests

@tekton-robot tekton-robot merged commit d2fcfc0 into tektoncd:master Jun 19, 2020
@GwonsooLee GwonsooLee deleted the tolerations_in_eventlistener branch June 19, 2020 03:57
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. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants