You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If any Ingress exists that references a non-existent IngressClass, oci-native-ingress-controller will no longer be able to build the ingress state for any IngressClass, rendering it non-functional
Cause
When building the ingress state for a given IngressClass, this code lists and iterates through all Ingress objects, and tries to determine if the Ingress is tied to the IngressClass being processed (i.e. via ingressClassName, or, if the Ingress has no ingressClassName defined, if the IngressClass is the default ingress class).
In doing this, for each Ingress object, it's calling util.GetIngressClass, which internally lists all IngressClasses and returns the IngressClass that is tied to the Ingress. However, if the Ingress in question references an IngressClass by name that doesn't exist, util.GetIngressClass will return an error (ingress class not found for ingress). The state building code will then exit early and return that error up the stack, meaning no Ingress state will be built and no load balancer will be updated. As long as ANY Ingress object exists that references an IngressClass that doesn't exist, no state can ever be built.
Solution
Since the ingress state building code is already operating on a specific IngressClass, we don't need to use the util.GetIngressClass code which lists all IngressClasses for every Ingress being processed. Instead, we can just compare the ingressClassName of each ingress against the name of the IngressClass being processed. If it matches, we include it in the group. If the ingressClassName is nil, we only include it if the IngressClass being processed is the default ingress class
I've opened a PR which I think addresses this issue here: #33
The text was updated successfully, but these errors were encountered:
Problem
If any Ingress exists that references a non-existent IngressClass, oci-native-ingress-controller will no longer be able to build the ingress state for any IngressClass, rendering it non-functional
Cause
When building the ingress state for a given IngressClass, this code lists and iterates through all Ingress objects, and tries to determine if the Ingress is tied to the IngressClass being processed (i.e. via ingressClassName, or, if the Ingress has no ingressClassName defined, if the IngressClass is the default ingress class).
In doing this, for each Ingress object, it's calling util.GetIngressClass, which internally lists all IngressClasses and returns the IngressClass that is tied to the Ingress. However, if the Ingress in question references an IngressClass by name that doesn't exist,
util.GetIngressClass
will return an error (ingress class not found for ingress). The state building code will then exit early and return that error up the stack, meaning no Ingress state will be built and no load balancer will be updated. As long as ANY Ingress object exists that references an IngressClass that doesn't exist, no state can ever be built.Solution
Since the ingress state building code is already operating on a specific IngressClass, we don't need to use the
util.GetIngressClass
code which lists all IngressClasses for every Ingress being processed. Instead, we can just compare the ingressClassName of each ingress against the name of the IngressClass being processed. If it matches, we include it in the group. If the ingressClassName is nil, we only include it if the IngressClass being processed is the default ingress classI've opened a PR which I think addresses this issue here: #33
The text was updated successfully, but these errors were encountered: