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
k8s Ingress: fix crash on rules with nil http #6121
k8s Ingress: fix crash on rules with nil http #6121
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Thanks! :) 👼
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
What does this PR do?
Fixes a crash when using the KubernetesIngress Provider if an Ingress has a rule without a
nil
http
element.This is a common case if you're using Let's Encrypt
http01
verification to create a certificate for a non-HTTP based service. Or in my case, the ingress just uses an annotation to HTTP redirect with ingress-nginx (which i'm migrating away from).Basically, just adds a
nil
check. Without thisnil
check a single ingress rule that has anil
http
element will make the entire provider not work.I also added a unit test to verify the change and to avoid it from happening again in the future.
Motivation
I'm trying to migrate to traefik from ingress-nginx and after hours of searching for why my secrets weren't being found, I finally dug into the nil pointer deference I was also seeing and it turned out that it was the culprit all along.
More
Additional Notes
This is targeting the master branch as during my testing it appeared that 0286836 may have had some impact on the secret resolution, but ultimately I don't think that really matters