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

k8s Ingress: fix crash on rules with nil http #6121

Merged
merged 2 commits into from Jan 7, 2020
Merged

k8s Ingress: fix crash on rules with nil http #6121

merged 2 commits into from Jan 7, 2020

Conversation

grimmy
Copy link
Contributor

@grimmy grimmy commented Jan 2, 2020

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 this nil check a single ingress rule that has a nil 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

  • Added/updated tests
  • Added/updated documentation

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

@ldez ldez changed the base branch from master to v2.1 January 2, 2020 05:19
@ldez ldez added this to the 2.1 milestone Jan 2, 2020
@ldez ldez added this to To review in v2 via automation Jan 2, 2020
Copy link
Member

@ldez ldez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks 👍

@ldez ldez requested a review from mpl January 7, 2020 09:20
Copy link
Collaborator

@SantoDE SantoDE left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks! :) 👼

Copy link
Contributor

@dtomcej dtomcej left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM
:shipit:

@traefiker traefiker merged commit bd67692 into traefik:v2.1 Jan 7, 2020
v2 automation moved this from To review to Done Jan 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
v2
Done
Development

Successfully merging this pull request may close these issues.

None yet

6 participants