@@ -86,7 +86,7 @@ public Map<String, Object> getFullSidecarDetails() {
8686 return report ;
8787 }
8888
89- private Map <String , String > parseErrorStatsOnly (String rawStats ) {
89+ private Map <String , String > parseErrorStatsOnly (String rawStats ) {
9090 Map <String , String > errorMap = new TreeMap <>();
9191 if (rawStats != null ) {
9292 rawStats .lines ()
@@ -127,30 +127,29 @@ private Map<String, Object> getEnvoyDetails() {
127127 return envoy ;
128128 }
129129
130+ // K8sDiagnosticService.java
130131 @ SuppressWarnings ("unchecked" )
131132 public List <Object > getIstioResources (String namespace , String type ) {
132133 try {
133- // Normalisierung des Typs (z.B. "gateway" -> "gateways")
134- String plural = type .toLowerCase ();
135- if (!plural .endsWith ("s" )) {
136- plural += "s" ;
137- }
134+ String plural = type .toLowerCase ().endsWith ("s" ) ? type .toLowerCase () : type .toLowerCase () + "s" ;
135+
136+ // Logge den Namespace für das Debugging
137+ logger .info ("Abfrage Istio API: Group={}, Namespace={}, Plural={}" , ISTIO_GROUP , namespace , plural );
138138
139- // Neuer Fluent-API Stil (ab SDK v12)
140- // Wir übergeben nur die 4 erforderlichen Parameter
141139 Object result = customObjectsApi
142140 .listNamespacedCustomObject (ISTIO_GROUP , ISTIO_VERSION , namespace , plural )
143141 .execute ();
144142
145143 if (result instanceof Map ) {
146- Map <String , Object > resultMap = (Map <String , Object >) result ;
147- return (List <Object >) resultMap .get ("items" );
144+ List <Object > items = (List <Object >) ((Map <String , Object >) result ).get ("items" );
145+ logger .info ("API Erfolg: {} Ressourcen gefunden." , items .size ());
146+ return items ;
148147 }
149148 } catch (Exception e ) {
150- logger .warn ( " Fehler beim Laden von {} in {} : {}" , type , namespace , e .getMessage ());
149+ logger .error ( "Kritischer Fehler beim API-Call ({}) : {}" , type , e .getMessage ());
151150 }
152151 return Collections .emptyList ();
153- }
152+ }
154153
155154 private String summarizeClusters (String rawClusters ) {
156155 if (rawClusters == null || rawClusters .isBlank ())
0 commit comments