Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KubernetesDeploy update to always close client and to fetch masterURL just once #9827

Merged
merged 1 commit into from
Jun 5, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ private Result doCheck() {
KubernetesClient client = KubernetesClientUtils.createClient();
String masterURL = client.getConfiguration().getMasterUrl();
try {
masterURL = client.getConfiguration().getMasterUrl();
//Let's check if we can connect.
VersionInfo version = client.getVersion();
if (version == null) {
Expand All @@ -79,7 +78,6 @@ private Result doCheck() {
log.info("Kubernetes API Server at '" + masterURL + "' successfully contacted.");
log.debugf("Kubernetes Version: %s.%s", version.getMajor(), version.getMinor());
serverFound = true;
client.close();
return Result.enabled();
} catch (Exception e) {
if (e.getCause() instanceof SSLHandshakeException) {
Expand All @@ -94,6 +92,8 @@ private Result doCheck() {
+ masterURL + "'",
e));
}
} finally {
client.close();
}
}

Expand Down