This is an automated email from the ASF dual-hosted git repository.

wusheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/skywalking.git


The following commit(s) were added to refs/heads/master by this push:
     new cf696ab698 Only list healthy Pods when forming OAP cluster (#10969)
cf696ab698 is described below

commit cf696ab698b59b76d2a61904fcdea351913b4406
Author: kezhenxu94 <[email protected]>
AuthorDate: Wed Jun 21 14:02:26 2023 +0800

    Only list healthy Pods when forming OAP cluster (#10969)
---
 .github/workflows/skywalking.yaml                                 | 4 ++--
 .../cluster/plugin/kubernetes/NamespacedPodListInformer.java      | 8 ++++----
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/.github/workflows/skywalking.yaml 
b/.github/workflows/skywalking.yaml
index 52226fb86e..e4f80444d6 100644
--- a/.github/workflows/skywalking.yaml
+++ b/.github/workflows/skywalking.yaml
@@ -750,8 +750,8 @@ jobs:
       matrix:
         analyzer: [k8s-mesh, mx-mesh]
         versions:
-          #- istio: 1.7.1
-          #  kubernetes: 18
+          - istio: 1.7.1
+            kubernetes: 18
           - istio: 1.8.2
             kubernetes: 19
           - istio: 1.9.1
diff --git 
a/oap-server/server-cluster-plugin/cluster-kubernetes-plugin/src/main/java/org/apache/skywalking/oap/server/cluster/plugin/kubernetes/NamespacedPodListInformer.java
 
b/oap-server/server-cluster-plugin/cluster-kubernetes-plugin/src/main/java/org/apache/skywalking/oap/server/cluster/plugin/kubernetes/NamespacedPodListInformer.java
index c8cad15935..d26923afec 100644
--- 
a/oap-server/server-cluster-plugin/cluster-kubernetes-plugin/src/main/java/org/apache/skywalking/oap/server/cluster/plugin/kubernetes/NamespacedPodListInformer.java
+++ 
b/oap-server/server-cluster-plugin/cluster-kubernetes-plugin/src/main/java/org/apache/skywalking/oap/server/cluster/plugin/kubernetes/NamespacedPodListInformer.java
@@ -23,6 +23,7 @@ import io.fabric8.kubernetes.client.KubernetesClientBuilder;
 import io.fabric8.kubernetes.client.informers.ResourceEventHandler;
 import io.fabric8.kubernetes.client.informers.cache.Lister;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.skywalking.library.kubernetes.KubernetesPods;
 
 import java.util.List;
 import java.util.Optional;
@@ -66,10 +67,9 @@ public enum NamespacedPodListInformer {
         }
         return Optional.ofNullable(podLister.list().size() != 0
             ? podLister.list()
-            .stream()
-            .filter(
-                item -> 
"Running".equalsIgnoreCase(item.getStatus().getPhase()))
-            .collect(Collectors.toList())
+                       .stream()
+                       .filter(KubernetesPods::isReady)
+                       .collect(Collectors.toList())
             : null);
     }
 }

Reply via email to