-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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 exception handler to SharedInformerFactory #1992
Add exception handler to SharedInformerFactory #1992
Conversation
Thanks for your pull request. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please follow instructions at https://git.k8s.io/community/CLA.md#the-contributor-license-agreement to sign the CLA. It may take a couple minutes for the CLA signature to be fully registered; after that, please reply here with a new comment and we'll verify. Thanks.
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. I understand the commands that are listed here. |
Relates to issue #1629 |
/check-cla |
util/src/main/java/io/kubernetes/client/informer/impl/DefaultSharedIndexInformer.java
Outdated
Show resolved
Hide resolved
This looks reasonable to me. Can you add unit tests to ensure we don't regress in the future? Thanks! |
@brendandburns Sorry for the confusion. Could you please link this pr to issue #1629. In #1629 (comment) I wanted to give @domainname the chance to confirm that this change will solve his problem. Sure it lacks reasonable default value handling, tests, and a little love ;) Will add it. |
66aa670
to
86f9e10
Compare
86f9e10
to
eb8e28b
Compare
util/src/test/java/io/kubernetes/client/informer/impl/DefaultSharedIndexInformerTest.java
Show resolved
Hide resolved
@@ -65,19 +66,34 @@ | |||
|
|||
private ScheduledFuture reflectorFuture; | |||
|
|||
/* visible for testing */ BiConsumer<Class<ApiType>, Throwable> exceptionHandler; | |||
|
|||
public Controller( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if these constructor chains are a good strategy long term. The best option I currently see is
- add a builder for the class
- use the all params constructor from the builder
- deprecate all constructors with partial param sets
Also I would try to get rid of the many new calls here via factories. This could improve testability and introduce entry points for people who want to influence behaviour. A larger change but could be done in baby steps. What do you think @brendandburns ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you file this as an issue so we can have a broader discussion? I want to get @yue9944882 to weigh in as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yay, have created issue #1995 for discussion. Looking forward to if :)
@brendandburns Now it is ready for review. Could you take a look into it, please. I have added some comments. But they are more kind of a discussion. Is there a place to discuss issues? |
util/src/test/java/io/kubernetes/client/informer/cache/ReflectorRunnableTest.java
Outdated
Show resolved
Hide resolved
This looks good to me, but would like @yue9944882 to look at the test refactor to make sure we didn't lose any coverage. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/lgtm
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: cbuschka, yue9944882 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 |
No description provided.