Skip to content

Conversation

sunjayBhatia
Copy link
Member

@sunjayBhatia sunjayBhatia commented Nov 17, 2022

What type of PR is this?
/kind cleanup
/kind documentation

What this PR does / why we need it:
Fixes documentation on HTTPRoute filters for when incompatible filters are present.

Adds PartiallyInvalid Route condition with one example Reason, "IncompatibleFilters"

This condition can be used in cases where cases where some configuration is valid but some is not (so Accepted=True, but not everything is valid/supported)

Which issue(s) this PR fixes:
Fixes #1521
Fixes #1696

Does this PR introduce a user-facing change?:

Add PartiallyInvalid Route condition to reflect Route status that is partially unsupported or invalid for an implementation.

@k8s-ci-robot k8s-ci-robot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/documentation Categorizes issue or PR as related to documentation. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Nov 17, 2022
@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Nov 17, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @sunjayBhatia. 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 the size/S Denotes a PR that changes 10-29 lines, ignoring generated files. label Nov 17, 2022
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 @sunjayBhatia!

@robscott
Copy link
Member

/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 17, 2022
@robscott robscott added this to the v0.6.0 milestone Nov 17, 2022
@k8s-ci-robot k8s-ci-robot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Nov 21, 2022
@sunjayBhatia
Copy link
Member Author

sunjayBhatia commented Nov 22, 2022

From discussion in the community meeting, this change may transition to be a more general "PartiallyInvalid" Condition that we can add the specific reason to, still to be discussed so no longer part of 0.6.0

This edge-case is caught by environments that have the webhook installed so not something that can come up in practice (at least with the existing known conflicting filters)

@robscott robscott modified the milestones: v0.6.0, v0.7.0 Nov 22, 2022
@shaneutt
Copy link
Member

@sunjayBhatia just wanted to check in on the status of this one: is there any assistance we can provide to help move this one forward, as it's been sitting for some time?

@sunjayBhatia
Copy link
Member Author

@sunjayBhatia just wanted to check in on the status of this one: is there any assistance we can provide to help move this one forward, as it's been sitting for some time?

just lost track of it, should make some more changes soon 👍🏽

@shaneutt
Copy link
Member

shaneutt commented Feb 2, 2023

just lost track of it, should make some more changes soon 👍🏽

Ok! Thanks Sunjay 🤜🤛

@pleshakov
Copy link
Contributor

would it make sense to also consider how reporting incompatible filters would work when filters are part of an HTTPBackendRef? Will conditions and reasons be the same?

@shaneutt
Copy link
Member

shaneutt commented Mar 8, 2023

Just checking in again @sunjayBhatia, do you need any help here to move this one forward?

@sunjayBhatia sunjayBhatia requested a review from robscott April 3, 2023 23:30
Copy link
Contributor

@pleshakov pleshakov left a comment

Choose a reason for hiding this comment

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

Hi @sunjayBhatia Please see my review.

In addition to the inline comments:

Currently, in httproute_types.go, there are a number of comments like below:

// Unknown values here must result in the implementation setting the
// Accepted Condition for the Route to status: False, with a
// Reason of UnsupportedValue.

Considering the new PartiallyInvalid condition, would it make sense to update them?

//
// Possible reasons for this condition to be true are:
//
// * "IncompatibleFilters"
Copy link
Contributor

Choose a reason for hiding this comment

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

do we need to clarify somewhere what the data plane should return in any of those cases?

Copy link
Member Author

Choose a reason for hiding this comment

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

I've been torn on what to do here, since this may end up being somewhat implementation-specific, depending on the field

Copy link
Member Author

Choose a reason for hiding this comment

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

we could recommend a 500, similar to what happens when ResolvedRefs is set due to missing Service/ReferenceGrant (since a lot of these are covered by apiserver validation not sure how we'll write conformance tests etc.)

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, the exact behavior here depends on the field - for most HTTPRoute things, the field value tells you what to do for an invalid rule (return 500), and what to do if your whole Route is invalid (I think it's reject the whole route, but aren't sure).

@shaneutt shaneutt modified the milestones: v0.7.0, v0.7.1 Apr 6, 2023
@shaneutt
Copy link
Member

shaneutt commented May 3, 2023

@sunjayBhatia it appears to me in order to move this one forward there's some comments you'll need to look over. Sorry about how long it's taking, I'm doing a roundup of older PRs to see if we can start shoring some of these up. Let us know how we can best help you in this 🖖

@sunjayBhatia
Copy link
Member Author

Hi @sunjayBhatia Please see my review.

In addition to the inline comments:

Currently, in httproute_types.go, there are a number of comments like below:

// Unknown values here must result in the implementation setting the
// Accepted Condition for the Route to status: False, with a
// Reason of UnsupportedValue.

Considering the new PartiallyInvalid condition, would it make sense to update them?

Feels like we should find a place to abstract this sort of thing out in the top-level Route documentation or otherwise rather than having to say this on each individual field, similar for the existing UnsupportedValue docs

Signed-off-by: Sunjay Bhatia <[email protected]>
@sunjayBhatia sunjayBhatia force-pushed the incompatible-filters-documentation branch from 7be9ca9 to 9b37a3e Compare May 18, 2023 19:47
@sunjayBhatia
Copy link
Member Author

Hi @sunjayBhatia Please see my review.
In addition to the inline comments:
Currently, in httproute_types.go, there are a number of comments like below:

// Unknown values here must result in the implementation setting the
// Accepted Condition for the Route to status: False, with a
// Reason of UnsupportedValue.

Considering the new PartiallyInvalid condition, would it make sense to update them?

Feels like we should find a place to abstract this sort of thing out in the top-level Route documentation or otherwise rather than having to say this on each individual field, similar for the existing UnsupportedValue docs

for reviewers, take a look at 9b37a3e, put the documentation about partial invalidity in the route status section doc

@sunjayBhatia sunjayBhatia requested a review from pleshakov May 18, 2023 19:55
@sunjayBhatia
Copy link
Member Author

One thing for reviewers/participants on this issue, do we have a document where we state explicitly that implementations "MUST" try to reconcile/program/process a whole resource, regardless of whether they encounter an invalid value etc?

Seems like that is missing from https://gateway-api.sigs.k8s.io/concepts/guidelines/ but could be a worthy addition

@k8s-ci-robot k8s-ci-robot added the release-note Denotes a PR that will be considered when it comes time to generate release notes. label May 18, 2023
@youngnick
Copy link
Contributor

I'm happy with this as it stands today, so I'll approve and hold.

/approve
/hold

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label May 24, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sunjayBhatia, youngnick

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 May 24, 2023
@robscott robscott modified the milestones: v0.7.1, v0.8.0 May 30, 2023
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 @sunjayBhatia! Sorry I missed this one, added a suggestion for how this could be split up into two smaller pieces.

Comment on lines +208 to +211
// document that limitation. In cases where incompatible or unsupported
// filters are specified on subset of the rules on a route, implementations
// MUST add the `PartiallyInvalid` error condition with status `True` and
// reason `IncompatibleFilters`.
Copy link
Member

Choose a reason for hiding this comment

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

This PR feels like it's combining 2 improvements that are related but different:

  1. A new PartiallyInvalid reason when only a subset or rules in a Route are invalid
  2. A new IncompatibleFilters reason

It seems like the following reasons could apply to an individual rule or the entire route:

  • IncompatibleFilters
  • UnsupportedValue (Accepted)
  • BackendNotFound (ResolvedRefs)
  • InvalidKind (ResolvedRefs)
  • RefNotPermitted (ResolvedRefs)

Currently ResolvedRefs is only true if 100% of refs are resolved, that's probably fine to leave as is, but it may be confusing for ResolvedRefs to be true and PartiallyInvalid to be false.

I think the simplest path forward would be to add IncompatibleFilters as a possible reason for Accepted. Adding a PartiallyInvalid condition to reflect that a portion of rules are invalid makes sense, but I think we'd need to make broader changes to the other conditions on the route to have that make sense.

Another option would be to say that both IncompatibleFilters and UnsupportedValue reasons could be used for Accepted and PartiallyInvalid conditions. When used with the Accepted condition, nothing in the Route would be reconciled, but when used with the PartiallyInvalid condition, the valid subset of the Route would be reconciled. We could potentially leave ResolvedRefs and the associated reasons as a special case that always applies to the entire route since I think our recommended behavior is just to return 404s in those cases and not actually to stop reconciling anything. I'm less sure about this approach though, so maybe it's better as a follow up.

Copy link
Member Author

Choose a reason for hiding this comment

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

added #2150 to start over and not have to disentagle the changes from this PR

Comment on lines +134 to +135
filters are specified, implementations MUST add the `PartiallyInvalid` error
condition with status `True` and reason `IncompatibleFilters`.
Copy link
Member

Choose a reason for hiding this comment

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

Related to my comment above, this guidance doesn't really add up because the PartiallyInvalid condition is only intended for cases where a subset of rules are invalid, but here we're saying that it needs to be set anytime there are incompatible filters.

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 30, 2023
@k8s-ci-robot
Copy link
Contributor

PR needs rebase.

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.

@shaneutt
Copy link
Member

shaneutt commented Jul 3, 2023

@sunjayBhatia from what I can tell, there's a couple open comments holding this up and we need a rebase in order to move forward. Let us know how we can be helpful with this one to keep it progressing? It's more than half a year old now and if there are some ways we can help pull this one over the finish line let us know? 🤔

@sunjayBhatia
Copy link
Member Author

#2150 supercedes this so can close this one

@sunjayBhatia
Copy link
Member Author

re: this comment: #1540 (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. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/documentation Categorizes issue or PR as related to documentation. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. release-note Denotes a PR that will be considered when it comes time to generate release notes. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

Define how to reflect partial validity of routing rules in the HTTPRoute status webhook/conformance: Handle incompatible HTTP Filters on a rule
7 participants