Aias00 opened a new issue, #6490:
URL: https://github.com/apache/shenyu/issues/6490
### Current Behavior
`GrpcParser` can throw `NullPointerException` when an ingress backend
references a service whose `Endpoints` object is not available yet.
Both default backend parsing and rule backend parsing dereference the
endpoints object immediately:
```java
V1Endpoints v1Endpoints =
endpointsLister.namespace(namespace).get(serviceName);
List<V1EndpointSubset> subsets = v1Endpoints.getSubsets();
```
During rollout, scale-up, or informer ordering, the service can exist while
the matching endpoints object is temporarily absent.
### Expected Behavior
gRPC ingress parsing should tolerate missing endpoints and return an empty
upstream list, allowing a later reconcile to add upstreams when endpoints
become available.
### Steps to Reproduce
1. Create a gRPC ingress referencing a service before endpoints are present.
2. Let the Kubernetes controller reconcile the ingress.
3. `GrpcParser` can throw while reading `v1Endpoints.getSubsets()`.
### Code Location
-
`shenyu-kubernetes-controller/src/main/java/org/apache/shenyu/k8s/parser/GrpcParser.java`
- `parseDefaultService()` and `parseUpstream()` dereference `v1Endpoints`
without a null check.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]