Skip to content

Conversation

@pmalek
Copy link
Contributor

@pmalek pmalek commented Nov 8, 2022

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

- Add `RouteReasonNoMatchingParent` reason for `Accepted` condition set on routes when no matching parent has been found

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Nov 8, 2022
@k8s-ci-robot
Copy link
Contributor

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 /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

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.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 8, 2022
@pmalek pmalek marked this pull request as ready for review November 8, 2022 13:27
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Nov 8, 2022
@pmalek pmalek changed the title feat: add RouteReasonNoMatchingParent feat: add RouteReasonNoMatchingParent Nov 8, 2022
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 8, 2022
@shaneutt
Copy link
Member

shaneutt commented Nov 8, 2022

Approved, couple small comments. I'll let Rob or Nick do the final lgtm.

Copy link
Member

@robscott robscott left a 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.

Comment on lines 1 to 15
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
---
Copy link
Member

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:

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense. PTAL.

@robscott
Copy link
Member

robscott commented Nov 8, 2022

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Nov 8, 2022
@pmalek pmalek requested review from robscott and removed request for bowei, keithmattix and mikemorris November 8, 2022 21:21
Copy link
Member

@robscott robscott left a 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.

Comment on lines 14 to 15
# mismatched port here (81 is not an available gateway listener) triggers NoMatchingParent reason
port: 81
Copy link
Member

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.

Copy link
Member

@shaneutt shaneutt Nov 9, 2022

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.

Copy link
Contributor Author

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

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"},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Got it. PTAL

@pmalek pmalek requested a review from robscott November 9, 2022 21:23
Copy link
Member

@robscott robscott left a 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.

@robscott
Copy link
Member

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.

@pmalek pmalek force-pushed the add-accepted-routereason-nomatchingparent branch from ca05e07 to 06bd152 Compare November 15, 2022 13:37
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 15, 2022
@pmalek pmalek force-pushed the add-accepted-routereason-nomatchingparent branch from 06bd152 to e932a6c Compare November 15, 2022 13:40
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Nov 15, 2022
@pmalek
Copy link
Contributor Author

pmalek commented Nov 15, 2022

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.

@robscott Sorry for the delay. I did manage to update the PR as you described. Apparently it needed a make fmt (make generate didn't produce any differences).

@shaneutt shaneutt requested a review from robscott November 15, 2022 16:22
Copy link
Member

@robscott robscott left a 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

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 15, 2022
@k8s-ci-robot
Copy link
Contributor

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

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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

4 participants