File tree Expand file tree Collapse file tree
test-integration/operator-tests/src/test/java/org/infinispan/operator Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66import java .util .List ;
77import java .util .Map ;
88import java .util .concurrent .TimeUnit ;
9+ import java .util .function .Predicate ;
910import java .util .regex .Pattern ;
1011import java .util .stream .Collectors ;
1112import java .util .stream .StreamSupport ;
@@ -131,7 +132,12 @@ void serviceMonitorTest() throws IOException {
131132 throw new IllegalStateException ("Invalid targets: " + targets );
132133 }
133134
134- List <JsonNode > actualList = StreamSupport .stream (activeTargets .spliterator (), false ).collect (Collectors .toList ());
135+ String crPrometheusLabel = "__meta_kubernetes_endpoints_label_infinispan_cr" ;
136+ Predicate <JsonNode > infinispanFilter = p ->
137+ p .get ("discoveredLabels" ).has (crPrometheusLabel ) &&
138+ p .get ("discoveredLabels" ).get (crPrometheusLabel ).asText ().equals (appName );
139+
140+ List <JsonNode > actualList = StreamSupport .stream (activeTargets .spliterator (), false ).filter (infinispanFilter ).collect (Collectors .toList ());
135141 List <String > targetIPs = actualList .stream ().map (t -> t .get ("discoveredLabels" ).get ("__meta_kubernetes_pod_ip" ).asText ()).collect (Collectors .toList ());
136142 List <String > targetHealths = actualList .stream ().map (t -> t .get ("health" ).asText ()).collect (Collectors .toList ());
137143
You can’t perform that action at this time.
0 commit comments