-
Notifications
You must be signed in to change notification settings - Fork 617
feat: add RouteReasonNoMatchingParent
#1516
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
feat: add RouteReasonNoMatchingParent
#1516
Conversation
|
Hi @pmalek. Thanks for your PR. I'm waiting for a kubernetes-sigs member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
RouteReasonNoMatchingParent
conformance/tests/httproute-invalid-backendref-not-matching-listener-port.go
Outdated
Show resolved
Hide resolved
conformance/tests/httproute-invalid-backendref-not-matching-listener-port.go
Show resolved
Hide resolved
conformance/tests/httproute-invalid-backendref-not-matching-listener-port.yaml
Outdated
Show resolved
Hide resolved
|
Approved, couple small comments. I'll let Rob or Nick do the final lgtm. |
robscott
left a comment
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 @pmalek! This mostly LGTM, just a few nits.
conformance/tests/httproute-invalid-backendref-not-matching-listener-port.go
Outdated
Show resolved
Hide resolved
| apiVersion: gateway.networking.k8s.io/v1beta1 | ||
| kind: Gateway | ||
| metadata: | ||
| name: gateway-listener-not-matching-route-port | ||
| namespace: gateway-conformance-infra | ||
| spec: | ||
| gatewayClassName: "{GATEWAY_CLASS_NAME}" | ||
| listeners: | ||
| - name: listener-1 | ||
| port: 80 | ||
| protocol: HTTP | ||
| allowedRoutes: | ||
| namespaces: | ||
| from: Same | ||
| --- |
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.
Every Gateway we use in conformance tests adds some real costs. I think we could just reuse one of our base Gateways instead of deploying a new one here, for example this one could just be referenced by the HTTPRoute below:
gateway-api/conformance/base/manifests.yaml
Lines 16 to 29 in 53e55ea
| apiVersion: gateway.networking.k8s.io/v1beta1 | |
| kind: Gateway | |
| metadata: | |
| name: same-namespace | |
| namespace: gateway-conformance-infra | |
| spec: | |
| gatewayClassName: "{GATEWAY_CLASS_NAME}" | |
| listeners: | |
| - name: http | |
| port: 80 | |
| protocol: HTTP | |
| allowedRoutes: | |
| namespaces: | |
| from: Same |
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.
Makes sense. PTAL.
|
/ok-to-test |
robscott
left a comment
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.
Sorry I missed some key details in my first review, a few more comments now that I've taken a closer look. I this is really everything now though.
| # mismatched port here (81 is not an available gateway listener) triggers NoMatchingParent reason | ||
| port: 81 |
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.
Not sure how I missed this, but this would only be invalid if it was on the parentRef, not the backendRef. We should be able to forward traffic to backends on any port.
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.
Whoa, whoops! I did it too, zoomed right over it. Good catch.
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.
Of course I missed it 🤦
| ) | ||
|
|
||
| func init() { | ||
| ConformanceTests = append(ConformanceTests, HTTPRouteInvalidBackendRefNotMatchingListenerPort) |
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 every instance of "InvalidBackendRef" in this PR should be renamed "InvalidParentRef" as a follow up to my other comment
| var HTTPRouteInvalidBackendRefNotMatchingListenerPort = suite.ConformanceTest{ | ||
| ShortName: "HTTPRouteInvalidBackendRefNotMatchingListenerPort", | ||
| Description: "A single HTTPRoute in the gateway-conformance-infra namespace should set the Accepted status to False with reason NoMatchingParent when attempting to bind to a Gateway that does not have a matching ListenerPort.", | ||
| Manifests: []string{"tests/httproute-invalid-backendref-not-matching-listener-port.yaml"}, |
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.
Since this is covering an experimental feature (Port on ParentRef), we need to feature gate this test. Something like https://github.com/kubernetes-sigs/gateway-api/blob/main/conformance/tests/httproute-response-header-modifier.go#L36 and https://github.com/kubernetes-sigs/gateway-api/blob/main/conformance/utils/suite/suite.go#L50.
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.
Got it. PTAL
robscott
left a comment
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 @pmalek! This change LGTM, it looks like you need to run codegen (make generate) though. It would also be nice if you could squash this change into a single commit.
|
Hey @pmalek, do you think you'll have time to take another look at this in the next ~day? We're just about ready to send v0.6.0 for API review and would love to include this in the release if possible. |
ca05e07 to
06bd152
Compare
06bd152 to
e932a6c
Compare
@robscott Sorry for the delay. I did manage to update the PR as you described. Apparently it needed a |
robscott
left a comment
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 @pmalek!
/lgtm
/approve
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: pmalek, robscott, shaneutt 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 |
What type of PR is this?
/kind feature
What this PR does / why we need it:
Which issue(s) this PR fixes:
Fixes #1511
Does this PR introduce a user-facing change?: