-
Notifications
You must be signed in to change notification settings - Fork 490
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: add test for disallowed route kind binding #1130
conformance: add test for disallowed route kind binding #1130
Conversation
Hi @skriss. 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. |
apiVersion: gateway.networking.k8s.io/v1alpha2 | ||
kind: Gateway | ||
metadata: | ||
name: tlsroutes-only | ||
namespace: gateway-conformance-infra | ||
spec: | ||
gatewayClassName: {GATEWAY_CLASS_NAME} | ||
listeners: | ||
- name: tls | ||
port: 443 | ||
protocol: TLS | ||
tls: | ||
mode: Passthrough | ||
allowedRoutes: | ||
namespaces: | ||
from: Same | ||
kinds: | ||
- kind: TLSRoute |
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.
Per #1104 (comment) it may be problematic for some implementations not to have the Gateway definitions in the base manifests, need to sort out the pattern here.
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.
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.
For reference, the alternative here would be to add more Gateways to our base set of resources instead. That would work, but could become difficult to maintain.
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.
Discussed in community meeting on Monday in reference to this and #1137 (comment). Apparently this ended up being a non issue for implementations now.
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!
This LGTM, but want to get feedback from other implementers on this one.
// TODO: Determine if this is actually what we want. It is likely | ||
// preferable to have status set with some kind of warning/error message | ||
// but that is also unlikely to be universally achievable. | ||
t.Run("Route should not have Parents set in status", func(t *testing.T) { | ||
parents := []v1alpha2.RouteParentStatus{} | ||
kubernetes.HTTPRouteMustHaveParents(t, suite.Client, routeName, parents, true, 60) | ||
}) |
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 don't think we need to block on this since other tests are already doing the same thing, but created #1135 to track this.
apiVersion: gateway.networking.k8s.io/v1alpha2 | ||
kind: Gateway | ||
metadata: | ||
name: tlsroutes-only | ||
namespace: gateway-conformance-infra | ||
spec: | ||
gatewayClassName: {GATEWAY_CLASS_NAME} | ||
listeners: | ||
- name: tls | ||
port: 443 | ||
protocol: TLS | ||
tls: | ||
mode: Passthrough | ||
allowedRoutes: | ||
namespaces: | ||
from: Same | ||
kinds: | ||
- kind: TLSRoute |
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.
For reference, the alternative here would be to add more Gateways to our base set of resources instead. That would work, but could become difficult to maintain.
Adds a test for a route that has a parentRef to a Gateway whose listeners don't allow the route type. Updates kubernetes-sigs#1104. Signed-off-by: Steve Kriss <krisss@vmware.com>
c4ba064
to
19ff2b8
Compare
/ok-to-test |
Thanks @skriss! /lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: robscott, 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 |
What type of PR is this?
conformance test (looks like we need a new kind)
What this PR does / why we need it:
Adds a test for a route that has a parentRef to a
Gateway whose listeners don't allow the route type.
This test largely follows the pattern from "invalid cross namespace", except it creates a new Gateway that disallows HTTPRoutes.
Which issue(s) this PR fixes:
Updates #1104.
Does this PR introduce a user-facing change?: