Skip to content

Commit

Permalink
build: Upgrade kubernetes client to latest stable version 5.6.0 (ecli…
Browse files Browse the repository at this point in the history
  • Loading branch information
skabashnyuk authored Jul 30, 2021
1 parent ccb8e4b commit 8132184
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
import io.fabric8.kubernetes.client.KubernetesClient;
import io.fabric8.kubernetes.client.utils.HttpClientUtils;
import io.fabric8.kubernetes.client.utils.ImpersonatorInterceptor;
import io.fabric8.kubernetes.client.utils.Utils;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.TimeUnit;
import javax.inject.Inject;
Expand Down Expand Up @@ -126,7 +125,23 @@ public void shutdownClient() {
connectionPool.evictAll();
}

Utils.shutdownExecutorService(executorService);
if (executorService != null && !executorService.isShutdown()) {
executorService.shutdown();
try {
Logger logger = LoggerFactory.getLogger(getClass());
logger.debug("Shutdown kubernetes client threads pool, wait 30s to stop normally");
if (!executorService.awaitTermination(30, TimeUnit.SECONDS)) {
executorService.shutdownNow();
logger.debug("Interrupt kubernetes client threads pool, wait 60s to stop");
if (!executorService.awaitTermination(60, TimeUnit.SECONDS)) {
logger.error("Couldn't shutdown kubernetes client threads pool");
}
}
} catch (InterruptedException x) {
executorService.shutdownNow();
Thread.currentThread().interrupt();
}
}
}

/** Retrieves the {@link OkHttpClient} instance shared by all Kubernetes clients. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ public void applySecret(KubernetesEnvironment env, RuntimeIdentity runtimeIdenti
.withName(secret.getMetadata().getName())
.withSecret(
new SecretVolumeSourceBuilder()
.withNewSecretName(secret.getMetadata().getName())
.withSecretName(secret.getMetadata().getName())
.build())
.build();

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
<commons-lang.version>2.6</commons-lang.version>
<integration.mysql.db.image>quay.io/eclipse/che--centos--mysql-57-centos7:latest-e08ee4d43b7356607685b69bde6335e27cf20c020f345b6c6c59400183882764</integration.mysql.db.image>
<integration.postgresql.db.image>quay.io/eclipse/che--centos--postgresql-96-centos7:9.6-b681d78125361519180a6ac05242c296f8906c11eab7e207b5ca9a89b6344392</integration.postgresql.db.image>
<io.fabric8.kubernetes-client>5.4.1</io.fabric8.kubernetes-client>
<io.fabric8.kubernetes-client>5.6.0</io.fabric8.kubernetes-client>
<io.github.mweirauch.micrometer-jvm-extras.version>0.1.3</io.github.mweirauch.micrometer-jvm-extras.version>
<io.jaegertracing.micrometer.version>1.0.0</io.jaegertracing.micrometer.version>
<io.jaegertracing.version>1.0.0</io.jaegertracing.version>
Expand Down

0 comments on commit 8132184

Please sign in to comment.