use of io.kubernetes.client.openapi.ApiClient in project java by kubernetes-client.
the class KubernetesInformerFactoryProcessor method informer.
@SuppressWarnings({ "unchecked", "rawtypes" })
private <T extends KubernetesObject> SharedInformer<T> informer(Class<T> type, KubernetesInformer kubernetesInformer) {
ApiClient apiClient = this.beanFactory.getBean(ApiClient.class);
if (apiClient.getHttpClient().readTimeoutMillis() > 0) {
log.warn("Enforcing read-timeout of the ApiClient {} to {} so that the watch connection won't abort from client-side", apiClient, informerProperties.getClientReadTimeout());
apiClient.setHttpClient(apiClient.getHttpClient().newBuilder().readTimeout(informerProperties.getClientReadTimeout()).build());
}
SharedInformerFactory sharedInformerFactory = this.beanFactory.getBean(SharedInformerFactory.class);
final GenericKubernetesApi api = new GenericKubernetesApi(kubernetesInformer.apiTypeClass(), kubernetesInformer.apiListTypeClass(), kubernetesInformer.groupVersionResource().apiGroup(), kubernetesInformer.groupVersionResource().apiVersion(), kubernetesInformer.groupVersionResource().resourcePlural(), apiClient);
SharedIndexInformer<T> sharedIndexInformer = sharedInformerFactory.sharedIndexInformerFor(api, type, kubernetesInformer.resyncPeriodMillis(), kubernetesInformer.namespace());
return sharedIndexInformer;
}
Aggregations