File tree Expand file tree Collapse file tree 4 files changed +17
-3
lines changed
examples-release-13/src/main/java/io/kubernetes/client/examples
examples-release-14/src/main/java/io/kubernetes/client/examples
examples-release-15/src/main/java/io/kubernetes/client/examples
util/src/main/java/io/kubernetes/client/informer Expand file tree Collapse file tree 4 files changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -41,12 +41,16 @@ public static void main(String[] args) throws Exception {
4141 apiClient .getHttpClient ().newBuilder ().readTimeout (0 , TimeUnit .SECONDS ).build ();
4242 apiClient .setHttpClient (httpClient );
4343
44- SharedInformerFactory factory = new SharedInformerFactory ();
44+ SharedInformerFactory factory = new SharedInformerFactory (apiClient );
4545
4646 // Node informer
4747 SharedIndexInformer <V1Node > nodeInformer =
4848 factory .sharedIndexInformerFor (
4949 (CallGeneratorParams params ) -> {
50+ // **NOTE**:
51+ // The following "CallGeneratorParams" lambda merely generates a stateless
52+ // HTTPs requests, the effective apiClient is the one specified when constructing
53+ // the informer-factory.
5054 return coreV1Api .listNodeCall (
5155 null ,
5256 null ,
Original file line number Diff line number Diff line change @@ -41,12 +41,16 @@ public static void main(String[] args) throws Exception {
4141 apiClient .getHttpClient ().newBuilder ().readTimeout (0 , TimeUnit .SECONDS ).build ();
4242 apiClient .setHttpClient (httpClient );
4343
44- SharedInformerFactory factory = new SharedInformerFactory ();
44+ SharedInformerFactory factory = new SharedInformerFactory (apiClient );
4545
4646 // Node informer
4747 SharedIndexInformer <V1Node > nodeInformer =
4848 factory .sharedIndexInformerFor (
4949 (CallGeneratorParams params ) -> {
50+ // **NOTE**:
51+ // The following "CallGeneratorParams" lambda merely generates a stateless
52+ // HTTPs requests, the effective apiClient is the one specified when constructing
53+ // the informer-factory.
5054 return coreV1Api .listNodeCall (
5155 null ,
5256 null ,
Original file line number Diff line number Diff line change @@ -41,11 +41,15 @@ public static void main(String[] args) throws Exception {
4141 apiClient .getHttpClient ().newBuilder ().readTimeout (0 , TimeUnit .SECONDS ).build ();
4242 apiClient .setHttpClient (httpClient );
4343
44- SharedInformerFactory factory = new SharedInformerFactory ();
44+ SharedInformerFactory factory = new SharedInformerFactory (apiClient );
4545
4646 // Node informer
4747 SharedIndexInformer <V1Node > nodeInformer =
4848 factory .sharedIndexInformerFor (
49+ // **NOTE**:
50+ // The following "CallGeneratorParams" lambda merely generates a stateless
51+ // HTTPs requests, the effective apiClient is the one specified when constructing
52+ // the informer-factory.
4953 (CallGeneratorParams params ) -> {
5054 return coreV1Api .listNodeCall (
5155 null ,
Original file line number Diff line number Diff line change @@ -49,6 +49,8 @@ public class SharedInformerFactory {
4949 private ApiClient apiClient ;
5050
5151 /** Constructor w/ default thread pool. */
52+ /** DEPRECATE: In favor of explicit apiClient constructor to avoid misguiding */
53+ @ Deprecated
5254 public SharedInformerFactory () {
5355 this (Configuration .getDefaultApiClient ().setReadTimeout (0 ), Executors .newCachedThreadPool ());
5456 }
You can’t perform that action at this time.
0 commit comments