Skip to content

[Umbrella Issue] Java SDK utility tooling improvement plan #523

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

Closed
6 of 10 tasks
yue9944882 opened this issue Mar 7, 2019 · 17 comments
Closed
6 of 10 tasks

[Umbrella Issue] Java SDK utility tooling improvement plan #523

yue9944882 opened this issue Mar 7, 2019 · 17 comments
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.

Comments

@yue9944882
Copy link
Member

yue9944882 commented Mar 7, 2019

/cc @brendandburns
/help-wanted

Bringing more use helpful utilities to k-client/java will help polyglot kubernetes developers to extend more projects, operators in the open source world.

Listing a few items we might get start w/ in the foreseeable future:

@k8s-ci-robot

This comment has been minimized.

@k8s-ci-robot k8s-ci-robot added the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label Mar 7, 2019
@brendandburns
Copy link
Contributor

This generally looks good, but I don't think the RESTMapper stuff is needed/useful?

(and in general I think the RESTMapper stuff in the go client is pretty badly designed anyway, so let's look at the use cases, not just translating go client concepts to Java)

Also, I think that we should consider moving some of this into a different library/directory.

I'd like to ensure we have both a "simple" and an "advanced" client experience, which I think client-go didn't do very well...

@yue9944882
Copy link
Member Author

Also, I think that we should consider moving some of this into a different library/directory.

what about a new java module under the root named client-java-extension or client-java-misc?

which I think client-go didn't do very well...

yeah, agree that we should list "provide better libraries than client-go" as a goal in the picture, especially making use of generic types.

@brendandburns
Copy link
Contributor

That sounds good, how about client-java-extended? or client-java-enhanced?

@karthikkondapally
Copy link
Contributor

karthikkondapally commented Mar 8, 2019 via email

@yue9944882
Copy link
Member Author

yue9944882 commented Mar 8, 2019

will it be okay, if i take a shot at Leader election utilities.

thank you so much for helping w/ this. matter of fact, we already got an existing utility package for leader-electing from our internal project and it's ready to be turn'd into a pull soon. i don't really mind a duplicate of the work but how do you think about getting on with the pagination? it's an equivalence to one of the client-go's pkg https://github.com/kubernetes/client-go/tree/master/tools/pager. i believe we're actually in a compaign that encouraging developers to apply pagination for every LIST calls, which is critical to large-scale kubernetes cluster. ref: https://groups.google.com/forum/#!topic/kubernetes-sig-api-machinery/SfCIk5MccOc

@karthikkondapally
Copy link
Contributor

@yue9944882 yup i will take up pagination.
i am a total noob in go.(i am trying to understand pager.go 😅)
i am trying to understand the understand requirement and TODO tasks.
list calls in this library already support pagination variables. for example list namespaced pods

V1PodList io.kubernetes.client.apis.CoreV1Api.listNamespacedPod(String namespace,
 Boolean includeUninitialized, String pretty, String _continue, 
String fieldSelector, String labelSelector, Integer limit, 
String resourceVersion, Integer timeoutSeconds, 
Boolean watch)

on type of such calls, do we want Pagination functionality on top of it ?

@brendandburns
Copy link
Contributor

brendandburns commented Mar 9, 2019

@kondapally1989

I would write an interface that is something like:

Iterator<T> listNamespacedWithPaging<T>(List<T> listFn(...), int pageSize) {
....
}

Basically, you want to transform one large list call into a series of small paginated list calls, and feed those items out as an iterator.

It's actually going to be tricky to do it right, because we don't have good base classes for everything so you will probably need to use reflection, or craft the right interface.

Hope that helps, let me know if there is additional questions.

@yue9944882
Copy link
Member Author

i am trying to understand the understand requirement and TODO tasks. list calls in this library already support pagination variables.

yes. we're actually performing pagination over those list calls over limit and continue queries which is already supported by kube-apiserver or rather etcd. while just as @brendandburns said, what we want is a package that wraps those queries into sth like iterator so that user won't deal w/ the list chunks directly.

@yue9944882
Copy link
Member Author

you will probably need to use reflection, or craft the right interface.

i'm slightly leaning on the latter one. sort of similar to CallGeneratorParams.java.

@yue9944882
Copy link
Member Author

/cc @wu8685 for the leader-election

@karthikkondapally
Copy link
Contributor

karthikkondapally commented Mar 21, 2019

SMP Patch client utilities--
does this refer to wrapper to solve #127 and to support different kinds of patches?

@yue9944882
Copy link
Member Author

yue9944882 commented Mar 21, 2019

@kondapally1989 oh this bug, sure we can start by fixing this as the first step. (btw in our internal fork, we workaround'd by hacking the parameter list of patch method to allow users to specify patch type, which i suppose is unacceptable in the community version?) while the item in this issue is about a utility library which helps dynamically construct patch body instead of formatting. sth like:

patch = diff(objectA, objectB)

btw server-side apply is landing k/k in 1.14, that would be a fine replacement for SMP in the future. but am not sure how will that feature work w/ openapi doc :P

denis554 added a commit to denis554/Kubernetes-Clients that referenced this issue Apr 16, 2019
@wu8685 wu8685 mentioned this issue Jun 8, 2019
@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Nov 11, 2019
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Dec 11, 2019
@fejta-bot
Copy link

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

@k8s-ci-robot
Copy link
Contributor

@fejta-bot: Closing this issue.

In response to this:

Rotten issues close after 30d of inactivity.
Reopen the issue with /reopen.
Mark the issue as fresh with /remove-lifecycle rotten.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/close

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed.
Projects
None yet
Development

No branches or pull requests

5 participants