Skip to content

Should I close the AppsAPIGroupDSL client? #6023

Answered by manusa
tinystorm asked this question in Q&A
Discussion options

You must be logged in to vote

Should I simply ignore this prompt?

Yes

my IDE (IDEA) prompts me to use it within a try-with-resources block

It's sort of a false positive.
All clients are derived from your original client. You should close the "original" client once you've completed all the work that requires the client.
For example, in a Spring Boot, Quarkus, or Jakarta application, you'd normally declare a KubernetesClient bean that'd be reused throughout the lifecycle of the application.
You'd then close the client once the application shuts down.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by tinystorm
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants