Fix `NullPointerException` in Istio ServiceEntry registry (#12087)

This commit is contained in:
kezhenxu94 2024-04-10 20:43:01 +08:00 committed by GitHub
parent bbbed44863
commit f5cd798185
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 5 additions and 0 deletions

View File

@ -93,6 +93,7 @@
- API `/api/v1/labels` and `/api/v1/label/<label_name>/values` support return matched metrics labels.
- OAL:
- Deprecate `percentile` function and introduce `percentile2` function instead.
* Fix `NullPointerException` in Istio ServiceEntry registry.
#### UI

View File

@ -74,6 +74,10 @@ public class IstioServiceEntryRegistry {
.filter(se -> !ignoredNamespaces.contains(se.getMetadata().getNamespace()))
.filter(se -> {
final var spec = se.getSpec();
if (spec.getResolution() == null) {
log.debug("Unsupported service entry resolution: {}", spec.getResolution());
return false;
}
switch (spec.getResolution()) {
case STATIC:
return spec