Skip to content

Commit

Permalink
Added informer(ExecutorService executor) method for managed environme…
Browse files Browse the repository at this point in the history
…nts.
  • Loading branch information
rohanKanojia committed Sep 19, 2019
1 parent 8851711 commit 3b24072
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

#### New Feature
* Added Template Instance Support
* Fix #1384: Initial draft for SharedInformer support.

### 4.5.2 (14-09-2019)
#### Bugs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Collection;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.ForkJoinPool;

public class DefaultKubernetesClient extends BaseClient implements NamespacedKubernetesClient {
Expand Down Expand Up @@ -323,4 +324,9 @@ public SharedInformerFactory informers() {
return new SharedInformerFactory(ForkJoinPool.commonPool(), httpClient, getConfiguration());
}

@Override
public SharedInformerFactory informers(ExecutorService executorService) {
return new SharedInformerFactory(executorService, httpClient, getConfiguration());
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@

import java.io.InputStream;
import java.util.Collection;
import java.util.concurrent.ExecutorService;

public interface KubernetesClient extends Client {

Expand Down Expand Up @@ -169,4 +170,6 @@ public interface KubernetesClient extends Client {

SharedInformerFactory informers();

SharedInformerFactory informers(ExecutorService executorService);

}
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
import java.net.URL;
import java.util.Collection;
import java.util.Map;
import java.util.concurrent.ExecutorService;

import static io.fabric8.kubernetes.client.Config.*;

Expand Down Expand Up @@ -402,6 +403,11 @@ public SharedInformerFactory informers() {
return delegate.informers();
}

@Override
public SharedInformerFactory informers(ExecutorService executorService) {
return delegate.informers(executorService);
}

@Override
public String getApiVersion() {
return delegate.getApiVersion();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.ForkJoinPool;

public class DefaultOpenShiftClient extends BaseClient implements NamespacedOpenShiftClient {
Expand Down Expand Up @@ -463,6 +464,9 @@ public AutoscalingAPIGroupDSL autoscaling() {
@Override
public SharedInformerFactory informers() { return new SharedInformerFactory(ForkJoinPool.commonPool(), httpClient, getConfiguration()); }

@Override
public SharedInformerFactory informers(ExecutorService executorService) { return new SharedInformerFactory(executorService, httpClient, getConfiguration()); }

@Override
public FunctionCallable<NamespacedOpenShiftClient> withRequestConfig(RequestConfig requestConfig) {
return new WithRequestCallable<NamespacedOpenShiftClient>(this, requestConfig);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
import java.net.URL;
import java.util.Collection;
import java.util.Map;
import java.util.concurrent.ExecutorService;

import static io.fabric8.kubernetes.client.Config.KUBERNETES_API_VERSION_SYSTEM_PROPERTY;
import static io.fabric8.kubernetes.client.Config.KUBERNETES_AUTH_BASIC_PASSWORD_SYSTEM_PROPERTY;
Expand Down Expand Up @@ -490,6 +491,9 @@ public AutoscalingAPIGroupDSL autoscaling() {
@Override
public SharedInformerFactory informers() { return delegate.informers(); }

@Override
public SharedInformerFactory informers(ExecutorService executorService) { return delegate.informers(executorService); }

@Override
public NamespacedOpenShiftClient inAnyNamespace() {
return delegate.inAnyNamespace();
Expand Down

0 comments on commit 3b24072

Please sign in to comment.