Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ingress state fails to build when an ingress exists which references a non-existent ingress class #34

Closed
mtweten opened this issue Nov 17, 2023 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@mtweten
Copy link
Contributor

mtweten commented Nov 17, 2023

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 class

I've opened a PR which I think addresses this issue here: #33

@Inbaraj-S
Copy link
Contributor

Thank you for reaching out, will look into it and get back on it.

@mtweten
Copy link
Contributor Author

mtweten commented Jan 2, 2024

Hey @Inbaraj-S, just checking if there has been any update on this? Thanks!

@Inbaraj-S
Copy link
Contributor

Thank you for reaching out. This PR is under review, we will get back to you on this.

@Inbaraj-S Inbaraj-S added the bug Something isn't working label Jan 25, 2024
@Inbaraj-S Inbaraj-S self-assigned this Jan 25, 2024
@Inbaraj-S
Copy link
Contributor

Fixed as part of release v1.3.2.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants