-
Notifications
You must be signed in to change notification settings - Fork 244
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
Use interface for kclient #5065
Use interface for kclient #5065
Conversation
1a6a1d9
to
7d9899a
Compare
@feloy I haven't reviewed the PR. My comment is based only on Do you think having smaller interfaces would be better than having one large interface? I am suggesting along the lines of creating an interface for each of the The reason I'm thinking this way is it makes testing easier because we can focus on implementing only a set of methods instead of a large number. Maybe using gomock we can automate the generation of mocks, but I remember reading on some official document that it's preferrable to have many smaller interfaces than one large interface. And in the end we can always make one big interface which takes all these interfaces if we really want a big interface, no? What are your thoughts? |
@dharmit I agree that interfaces should be small. Even with a large interface, Gomock will make easy to mock some methods only. |
@feloy thinking out loud here. If we're going to do this, would it provide benefit or be painful with those increased fields and parameters?
I admit that my comment is based more on the articles/docs I have read and not based on actual work done along these lines. :) |
@dharmit We could build a clientset similar to the client-go one: https://pkg.go.dev/k8s.io/client-go/kubernetes#Clientset (let me have a try...) |
/test v4.8-integration-e2e
|
d917fdc
to
7bfc800
Compare
/test v4.8-integration-e2e
|
@feloy: The following test failed, say
Full PR test history. Your PR dashboard. 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. |
7bfc800
to
c22dce1
Compare
Kudos, SonarCloud Quality Gate passed! 0 Bugs No Coverage information |
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.
/approve
/lgtm
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dharmit 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 |
@feloy thanks for getting this done! Just one question. We discussed on some call to name the interface as |
I didn't change for the moment, I prefer to change it in a next iteration of refactoring |
/kind cleanup
What does this PR do / why we need it:
PR acceptance criteria:
Unit test
Integration test
Documentation
I have read the test guidelines
How to test changes / Special notes to the reviewer: