We're not closing client in some of the examples after using it, we should either close it with client.close() or use KubernetesClient like this:
try (KubernetesClient client = new DefaultKubernetesClient()) {
// Use Client for your stuff
}
Here are some places where it's not closed properly:
There are some more occurrences listed in Sonar Bug report. You can have a look at it here.
/assign
@Shivkumar13 : polite ping, Are you still working on this issue?
@rohanKanojia apologies for the delay, I will update my findings in a day.
Was in other tasks for a while.
@rohanKanojia Is this issue still relevant? If yes, I would like to work on it.
Yes, it's still relevant. You might want to check with @Shivkumar13 if he is still working on it or not. There are lots of quickstarts that need to be updated, maybe you both can collaborate on refactoring these :-)
@Shivkumar13 if you are working on it can you give an update on which all quickstart have you worked already and which all are still pending? so that I can start working on this issue.
@HeroicHitesh I will raise a PR by tomorrow, need some cross checks
I have the fix ready, while raising PR, seeing some old git changes also popping up in this Fix.
I will rebase the branch and will try again tomorrow.
@Shivkumar13 any updates? You can send a PR for the files you have modified and I'll do the rest. Or if you are facing any issue related to Git/GitHub, let us know, maybe we can help you out
@HeroicHitesh already raised a PR, day before yesterday
See: https://github.com/fabric8io/kubernetes-client/pull/2567
@Shivkumar13 My bad I couldn't see any linked PR so thought you are stuck in that rebase thing. Now, from the PR I can see
https://github.com/fabric8io/kubernetes-client/blob/master/kubernetes-examples/src/main/java/io/fabric8/kubernetes/examples/LoadMultipleDocumentsFromFileExample.java
these 2 are fixed and the remaining are pending. Do you have other fixes ready or can I start working on them?
Also, @rohanKanojia can you please make a checkbox in-front of the links in the issue description, so that it's easy to track which files are fixed and which are still pending.
@HeroicHitesh : Thanks for pointing this out, I've updated the issue description.
@Shivkumar13 My bad I couldn't see any linked PR so thought you are stuck in that rebase thing. Now, from the PR I can see
https://github.com/fabric8io/kubernetes-client/blob/master/kubernetes-examples/src/main/java/io/fabric8/kubernetes/examples/LoadMultipleDocumentsFromFileExample.javathese 2 are fixed and the remaining are pending. Do you have other fixes ready or can I start working on them?
@HeroicHitesh I am not having other ready at the moment, but I can work on them, in the meantime, feel free to work on those.
please do list here the ones that you will be fixing. Then I can pick others.
Also, @rohanKanojia can you please make a checkbox in-front of the links in the issue description, so that it's easy to track which files are fixed and which are still pending.
@rohanKanojia I have sent a PR for the following files: