-
Notifications
You must be signed in to change notification settings - Fork 472
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
conformance: check reason in HTTPRouteInvalidCrossNamespaceParentRef test #1714
Conversation
conformance/tests/httproute-invalid-cross-namespace-parent-ref.go
Outdated
Show resolved
Hide resolved
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.
Looks good thank you 👍
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: shaneutt, skriss 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 |
I think this is OK, but we need to be careful here. As I recall, we don't require implementations to populate conditions on HTTPRoutes making cross-namespace references because some implementations may be running with limited access to namespace(s). We want to allow implementations to run in a restricted access mode, or even a single-namespace mode, and still allow them to be conformant. With that said, I think it's reasonable to require implementations running conformance tests to have cluster-wide visibility, so I think this LGTM, just need to be very clear that it is valid not to set this condition if you're running in a mode where you don't have visibility to all namespaces. |
@@ -37,6 +39,16 @@ var HTTPRouteInvalidCrossNamespaceParentRef = suite.ConformanceTest{ | |||
gwNN := types.NamespacedName{Name: "same-namespace", Namespace: "gateway-conformance-infra"} | |||
routeNN := types.NamespacedName{Name: "invalid-cross-namespace-parent-ref", Namespace: "gateway-conformance-web-backend"} | |||
|
|||
t.Run("HTTPRoute should have an Accepted: false condition with reason NotAllowedByListeners", func(t *testing.T) { |
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.
Maybe add a comment above this that clarifies that:
- We expect all implementations running conformance tests to have full namespace visibility and when they are running in that mode, this condition needs to be set.
- It is valid for controllers to run in modes where they have access to a subset of namespace(s). In that case, they are not obligated to populate this condition on routes they can't see.
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.
Ah, I hadn't considered that use case. If you think it's better to not merge this in order to continue to accommodate that use case, that's OK with me for now; otherwise, I'll add the comment you suggest. I imagine at some point we might need to incorporate that into a conformance profile (#1709)?
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 @skriss! I think it's good to add this test, just as long as we have a clarifying comment. I think even the implementations that were deployed with limited access by default would likely have a way to watch all namespaces for the sake of conformance tests, just want to make sure it's clear that's not required for every use of Gateway API.
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.
Comment added!
…test Checks for the NotAllowedByListeners reason on the HTTPRoute's Accepted: false condition in the HTTPRouteInvalidCrossNamespaceParentRef test. Signed-off-by: Steve Kriss <krisss@vmware.com>
Thanks @skriss! /lgtm |
conformance: check reason in HTTPRouteInvalidCrossNamespaceParentRef test
/cherry-pick release-0.6 |
Was just testing to see if the plugin was active |
We talked about this a bit in Slack: https://kubernetes.slack.com/archives/CR0H13KGA/p1678891960116929 The manual cherry-picking is fast and doesn't really bother me, but I too have been thinking about this plugin as well as some others (like triage) that we should be turning on to make things just that little bit more convenient. |
I've updated #1800 to include this. |
Checks for the NotAllowedByListeners reason on
the HTTPRoute's Accepted: false condition in
the HTTPRouteInvalidCrossNamespaceParentRef
test.
Signed-off-by: Steve Kriss krisss@vmware.com
What type of PR is this?
/area conformance
What this PR does / why we need it:
Checks for the NotAllowedByListeners reason on
the HTTPRoute's Accepted: false condition in
the HTTPRouteInvalidCrossNamespaceParentRef
test.
Which issue(s) this PR fixes:
Fixes #1705
Does this PR introduce a user-facing change?: