Skip to content

Commit 4868613

Browse files
csviriCopilot
andcommitted
improve: do not close infra client if same as client (#3187)
--------- Signed-off-by: Attila Mészáros <a_meszaros@apple.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 8144ddf commit 4868613

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

operator-framework-junit/src/main/java/io/javaoperatorsdk/operator/junit/LocallyRunOperatorExtension.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -365,7 +365,11 @@ protected void after(ExtensionContext context) {
365365
iterator.remove();
366366
}
367367

368-
kubernetesClient.close();
368+
// if the client is used for infra client, we should not close it
369+
// either test or operator should close this client
370+
if (getKubernetesClient() != getInfrastructureKubernetesClient()) {
371+
kubernetesClient.close();
372+
}
369373

370374
try {
371375
this.operator.stop();

0 commit comments

Comments
 (0)