Fixed unit of time mixing problem in kubernetes-client (#5777)

This commit is contained in:
Evan 2020-11-03 17:54:33 +08:00 committed by GitHub
parent 66dd848e84
commit cf563fcf58
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 6 deletions

View File

@ -23,6 +23,7 @@ Release Notes.
* Support choose files to active the meter analyzer.
* Improve Kubernetes service registry for ALS analysis.
* Improve the queryable tags generation. Remove the duplicated tags to reduce the storage payload.
* Fix the excessive timeout period set by the kubernetes-client.
#### UI

View File

@ -83,7 +83,7 @@ public enum NamespacedPodListInformer {
SharedIndexInformer<V1Pod> podSharedIndexInformer = factory.sharedIndexInformerFor(
params -> coreV1Api.listNamespacedPodCall(
podConfig.getNamespace(), null, null, null, null,
podConfig.getLabelSelector(), Integer.MAX_VALUE, params.resourceVersion, params.timeoutSeconds,
podConfig.getLabelSelector(), Integer.MAX_VALUE, params.resourceVersion, 300,
params.watch, null
),
V1Pod.class, V1PodList.class

View File

@ -73,7 +73,7 @@ public class ConfigurationConfigmapInformer {
SharedIndexInformer<V1ConfigMap> configMapSharedIndexInformer = factory.sharedIndexInformerFor(
params -> coreV1Api.listNamespacedConfigMapCall(
settings.getNamespace(), null, null, null, null, settings.getLabelSelector()
, 1, params.resourceVersion, params.timeoutSeconds, params.watch, null
, 1, params.resourceVersion, 300, params.watch, null
),
V1ConfigMap.class, V1ConfigMapList.class
);

View File

@ -108,7 +108,7 @@ class K8SServiceRegistry {
null,
null,
params.resourceVersion,
params.timeoutSeconds,
300,
params.watch,
null
),
@ -142,7 +142,7 @@ class K8SServiceRegistry {
null,
null,
params.resourceVersion,
params.timeoutSeconds,
300,
params.watch,
null
),
@ -176,7 +176,7 @@ class K8SServiceRegistry {
null,
null,
params.resourceVersion,
params.timeoutSeconds,
300,
params.watch,
null
),
@ -288,7 +288,8 @@ class K8SServiceRegistry {
log.error("Failed to evaluate service name.", e);
serviceMetaInfo.setServiceName(requireNonNull(service.getMetadata()).getName());
}
serviceMetaInfo.setServiceInstanceName(String.format("%s.%s", podMetadata.getName(), podMetadata.getNamespace()));
serviceMetaInfo.setServiceInstanceName(
String.format("%s.%s", podMetadata.getName(), podMetadata.getNamespace()));
serviceMetaInfo.setTags(transformLabelsToTags(podMetadata.getLabels()));
return serviceMetaInfo;