Single bad ingress prevents other ingresses from working
- Dominant language
- C#
- Stars
- 9.6k
- Forks
- 933
- Avg merge
- 12d 18h
- Merged PRs (30d)
- 2
Description
### Describe the bug
K8 controller fails to handle one of ingresses and as a result YARP configuration is empty.
### To Reproduce
Likely related to a service not having an endpoint because the corresponding pod is in a crash loop.
```
warn: Yarp.Kubernetes.Controller.Services.Reconciler[0]
Uncaught exception occured while reconciling
System.NullReferenceException: Object reference not set to an instance of an object.
at Yarp.Kubernetes.Controller.Converters.YarpParser.HandleIngressRulePath(YarpIngressContext ingressContext, V1ServicePort servicePort, List`1 endpoints, IList`1 defaultSubsets, V1IngressRule rule, V1HTTPIngressPath path, YarpConfigContext configContext) in src\Kubernetes.Controller\Converters\YarpParser.cs:line 79
at Yarp.Kubernetes.Controller.Converters.YarpParser.HandleIngressRule(YarpIngressContext ingressContext, List`1 endpoints, IList`1 defaultSubsets, V1IngressRule rule, YarpConfigContext configContext) in src\Kubernetes.Controller\Converters\YarpParser.cs:line 44
at Yarp.Kubernetes.Controller.Converters.YarpParser.ConvertFromKubernetesIngress(YarpIngressContext ingressContext, YarpConfigContext configContext) in src\Kubernetes.Controller\Converters\YarpParser.cs:line 31
at Yarp.Kubernetes.Controller.Services.Reconciler.ProcessAsync(CancellationToken cancellationToken) in src\Kubernetes.Controller\Services\Reconciler.cs:line 47
```
### Further technical details
Two issues here:
1. Exception handling in Reconciler.cs makes me think that single bad ingress prevents others from working. Shall it be moved inside the loop?
2. NullReferenceException that I'm trying to debug.
Contributor guide
Assessment
This issue has not been assessed yet.