Skip to content

Commit a60ff25

Browse files
authored
Merge pull request #4152 from iseki0/feat/client-builder-add-api-client
Add ApiClient in ClientBuilder
2 parents 03cdc92 + 407e1b7 commit a60ff25

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

util/src/main/java/io/kubernetes/client/util/ClientBuilder.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ public class ClientBuilder {
7373
// time to refresh exec based credentials
7474
// TODO: Read the expiration from the credential itself
7575
private Duration execCredentialRefreshPeriod = null;
76+
private ApiClient apiClient = null;
7677

7778
/**
7879
* Creates an {@link ApiClient} by calling {@link #standard()} and {@link #build()}.
@@ -435,8 +436,17 @@ public ClientBuilder setKeyStorePassphrase(String keyStorePassphrase) {
435436
return this;
436437
}
437438

439+
public ApiClient getApiClient() {
440+
return this.apiClient;
441+
}
442+
443+
public ClientBuilder setApiClient(ApiClient apiClient) {
444+
this.apiClient = apiClient;
445+
return this;
446+
}
447+
438448
public ApiClient build() {
439-
final ApiClient client = new ApiClient();
449+
final ApiClient client = this.apiClient == null ? new ApiClient() : this.apiClient;
440450

441451
client.setHttpClient(
442452
client

0 commit comments

Comments
 (0)