Open
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:
- Exception handling in Reconciler.cs makes me think that single bad ingress prevents others from working. Shall it be moved inside the loop?
- NullReferenceException that I'm trying to debug.