Skip to content

Commit

Permalink
changes for code review
Browse files Browse the repository at this point in the history
  • Loading branch information
24kpure committed Dec 24, 2024
1 parent b56e717 commit d2d578f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Apollo Java 2.4.0
* [Feature Support Kubernetes ConfigMap cache for Apollo java, golang client](https://github.com/apolloconfig/apollo-java/pull/79)
* [Feature support pulling configuration information from multiple AppIds](https://github.com/apolloconfig/apollo-java/pull/70)
* [Fix monitor arg cause npe](https://github.com/apolloconfig/apollo-java/pull/86)
* [Feature reduce conflicts when update configmap in k8](https://github.com/apolloconfig/apollo-java/pull/93)

------------------
All issues and pull requests are [here](https://github.com/apolloconfig/apollo-java/milestone/4?closed=1)
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@
public class KubernetesManager {
private static final Logger logger = LoggerFactory.getLogger(KubernetesManager.class);

private static final String RUNNING_POD_FIELD_SELECTOR = "status.phase=Running";

private static final int MAX_SEARCH_NUM = 1000;

private ApiClient client;
private CoreV1Api coreV1Api;
private int propertyKubernetesMaxWritePods;
Expand Down Expand Up @@ -244,8 +248,8 @@ private boolean isWritePod(String k8sNamespace) {
String labelSelector = "app=" + appName;

V1PodList v1PodList = coreV1Api.listNamespacedPod(k8sNamespace, null, null,
null, null, labelSelector,
null, null, null
null, RUNNING_POD_FIELD_SELECTOR, labelSelector,
MAX_SEARCH_NUM, null, null
, null, null);

return v1PodList.getItems().stream()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,13 @@
"description": "kubernetes configmap namespace.",
"defaultValue": "default"
},
{
"name": "apollo.cache.kubernetes.max-write-pods",
"type": "java.lang.String",
"sourceType": "com.ctrip.framework.apollo.util.ConfigUtil",
"description": "max number of pods that can write the configmap cache in Kubernetes.",
"defaultValue": "3"
},
{
"name": "apollo.property.order.enable",
"type": "java.lang.Boolean",
Expand Down

0 comments on commit d2d578f

Please sign in to comment.