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

Allow empty sectionName in HTTPRoute parentRef #626

Merged
merged 3 commits into from
May 9, 2023

Conversation

sjberman
Copy link
Contributor

@sjberman sjberman commented May 4, 2023

Support for empty sectionName in HTTPRoute parentRef. This will bind the route to all listeners with matching hostnames.

If multiple listeners match, we'll choose the most specific one (mainly for TLS case to ensure proper certs are used). Either way, we should end up with a single nginx server for the hostname. We could end up with duplicate match rules if multiple listeners match, but nginx/njs will send traffic properly. At some point we'll need to figure out how to de-dupe these.

Closes #479

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that all unit tests pass after adding my changes
  • I have updated necessary documentation
  • I have rebased my branch onto main
  • I will ensure my PR is targeting the main branch and pulling from my branch from my own fork

@sjberman sjberman requested a review from a team as a code owner May 4, 2023 21:29
@github-actions github-actions bot added documentation Improvements or additions to documentation enhancement New feature or request labels May 4, 2023
internal/state/dataplane/configuration.go Outdated Show resolved Hide resolved
internal/state/dataplane/configuration.go Outdated Show resolved Hide resolved
internal/state/dataplane/configuration.go Outdated Show resolved Hide resolved
internal/state/graph/httproute.go Outdated Show resolved Hide resolved
internal/state/graph/httproute.go Show resolved Hide resolved
Support for empty sectionName in HTTPRoute parentRef. This will bind the route to all listeners with matching hostnames.

If multiple listeners match, we'll choose the most specific one (mainly for TLS case to ensure proper certs are used). Either way, we should end up with a single nginx server for the hostname. We could end up with duplicate match rules if multiple listeners match, but nginx/njs will send traffic properly. At some point we'll need to figure out how to de-dupe these.
@sjberman sjberman force-pushed the feature/empty-sectionname branch from 5e006a9 to c9ae428 Compare May 9, 2023 15:13
Copy link
Contributor

@kate-osborn kate-osborn left a comment

Choose a reason for hiding this comment

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

@sjberman @pleshakov do you think this change warrants a new example?

internal/state/dataplane/configuration.go Outdated Show resolved Hide resolved
internal/state/graph/httproute.go Show resolved Hide resolved
@sjberman
Copy link
Contributor Author

sjberman commented May 9, 2023

@sjberman @pleshakov do you think this change warrants a new example?

To me it doesn't really feel like it needs it. Behaviorally, not much is really changing. It's more of removing a requirement.

@kate-osborn
Copy link
Contributor

@sjberman @pleshakov do you think this change warrants a new example?

To me it doesn't really feel like it needs it. Behaviorally, not much is really changing. It's more of removing a requirement.

Fair enough. Can we just remove one of the sectionNames from an example so we can exercise this code when we manually test?

@kate-osborn kate-osborn self-requested a review May 9, 2023 19:14
Copy link
Contributor

@kate-osborn kate-osborn left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@pleshakov pleshakov left a comment

Choose a reason for hiding this comment

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

👍

@sjberman sjberman merged commit 56e43d6 into nginxinc:main May 9, 2023
@sjberman sjberman deleted the feature/empty-sectionname branch May 9, 2023 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Core API: Support empty SectionName in HTTPRoute ParentRef
3 participants