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

conformance: check reason in HTTPRouteInvalidCrossNamespaceParentRef test #1714

Merged
merged 1 commit into from
Feb 13, 2023

Conversation

skriss
Copy link
Contributor

@skriss skriss commented Feb 8, 2023

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?:

Checks for the NotAllowedByListeners reason on
the HTTPRoute's Accepted: false condition in
the HTTPRouteInvalidCrossNamespaceParentRef
conformance test.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 8, 2023
@k8s-ci-robot k8s-ci-robot added the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Feb 8, 2023
Copy link
Member

@shaneutt shaneutt left a 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 👍

@k8s-ci-robot
Copy link
Contributor

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Feb 8, 2023
@robscott
Copy link
Member

robscott commented Feb 8, 2023

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) {
Copy link
Member

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:

  1. 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.
  2. 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.

Copy link
Contributor Author

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)?

Copy link
Member

@robscott robscott Feb 10, 2023

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.

Copy link
Contributor Author

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>
@robscott
Copy link
Member

Thanks @skriss!

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Feb 13, 2023
@k8s-ci-robot k8s-ci-robot merged commit b4483f9 into kubernetes-sigs:main Feb 13, 2023
@shaneutt shaneutt added this to the v0.6.2 milestone Mar 14, 2023
shaneutt pushed a commit to shaneutt/gateway-api that referenced this pull request Mar 14, 2023
conformance: check reason in HTTPRouteInvalidCrossNamespaceParentRef test
@dprotaso
Copy link
Contributor

/cherry-pick release-0.6

@dprotaso
Copy link
Contributor

Was just testing to see if the plugin was active

@robscott
Copy link
Member

@dprotaso x-ref #1800, probably want to enable some more plugins, agree that cherry-pick would be very helpful.

@shaneutt
Copy link
Member

@dprotaso x-ref #1800, probably want to enable some more plugins, agree that cherry-pick would be very helpful.

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.

@shaneutt
Copy link
Member

I've updated #1800 to include this.

@skriss skriss deleted the pr-fix-1705 branch July 20, 2023 17:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/conformance cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

HTTPRouteInvalidCrossNamespaceParentRef check for NotAllowedByListeners
5 participants