-
Notifications
You must be signed in to change notification settings - Fork 1.5k
fix http / grpc route rule generation #4316
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
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: zac-nixon The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
HttpSpecificRulePrecedenceFactor: &HttpSpecificRulePrecedenceFactor{}, | ||
CommonRulePrecedence: common, | ||
} | ||
httpRoutes = append(httpRoutes, match) |
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.
i think getHttpMatchPrecedenceInfo(&httpMatch, &match)
is missing when route does not match. it is ok for most of them (headers/query params) because if those does not get specified,they will have default value 0 or false. but at least for pathType, we want to treat them like prefix /*
func getHttpMatchPrecedenceInfo(httpMatch *v1.HTTPRouteMatch, matchPrecedence *RulePrecedence) {
matchPrecedence.HttpSpecificRulePrecedenceFactor.PathType = getHttpRoutePathType(httpMatch.Path)
// httpMatch.Path.Value won't be nil, default is /
matchPrecedence.HttpSpecificRulePrecedenceFactor.PathLength = len(*httpMatch.Path.Value)
matchPrecedence.HttpSpecificRulePrecedenceFactor.HasMethod = httpMatch.Method != nil
matchPrecedence.HttpSpecificRulePrecedenceFactor.HeaderCount = len(httpMatch.Headers)
matchPrecedence.HttpSpecificRulePrecedenceFactor.QueryParamCount = len(httpMatch.QueryParams)
}
Unknown CLA label state. Rechecking for CLA labels. Send feedback to sig-contributor-experience at kubernetes/community. /check-cla |
…GRPC upgrade using TG config
This reverts commit 2bebac5.
Description
When no matches are given to for a HTTP / GRPC Route Rule, the controller doesn't generate any ALB rules. This behavior is incorrect as per the Gateway API documentation:
For GRPC routes -
For HTTP routes -
This PR implements the logic as specified ^^^. I also added unit tests to validate the change worked. I was able to validate my GRPC set up now works with this change.
Checklist
README.md
, or thedocs
directory)BONUS POINTS checklist: complete for good vibes and maybe prizes?! 🤯