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 11, 2019
1 parent cd5cfd8 commit f0f2ec2
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 @@ -9,6 +9,7 @@
#### Dependency Upgrade

#### New Feature
* Initial draft for SharedInformer support.


### 4.5.0 (10-09-2019)
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 @@ -73,6 +73,7 @@
import java.util.Collection;
import java.util.List;
import java.util.Objects;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.ForkJoinPool;

public class DefaultOpenShiftClient extends BaseClient implements NamespacedOpenShiftClient {
Expand Down Expand Up @@ -429,6 +430,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 @@ -42,6 +42,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 @@ -482,6 +483,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 f0f2ec2

Please sign in to comment.