-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Kubernetes extension doesn't leak KubernetesClient resources
Signed-off-by: Marc Nuri <[email protected]>
- Loading branch information
Showing
8 changed files
with
105 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
.../runtime/src/main/java/io/quarkus/kubernetes/client/runtime/QuarkusHttpClientFactory.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 13 additions & 5 deletions
18
...-client/spi/src/main/java/io/quarkus/kubernetes/client/spi/KubernetesClientBuildItem.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,26 @@ | ||
package io.quarkus.kubernetes.client.spi; | ||
|
||
import java.util.function.Supplier; | ||
|
||
import io.fabric8.kubernetes.client.Config; | ||
import io.fabric8.kubernetes.client.KubernetesClient; | ||
import io.fabric8.kubernetes.client.KubernetesClientBuilder; | ||
import io.quarkus.builder.item.SimpleBuildItem; | ||
|
||
public final class KubernetesClientBuildItem extends SimpleBuildItem { | ||
|
||
private final KubernetesClient client; | ||
private final Config config; | ||
|
||
public KubernetesClientBuildItem(Config config) { | ||
this.config = config; | ||
} | ||
|
||
public KubernetesClientBuildItem(KubernetesClient client) { | ||
this.client = client; | ||
public Supplier<KubernetesClient> getClient() { | ||
return () -> new KubernetesClientBuilder().withConfig(config).build(); | ||
} | ||
|
||
public KubernetesClient getClient() { | ||
return this.client; | ||
public Config getConfig() { | ||
return config; | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.