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

multiple fixes to HTTPRequestRedirect filter #863

Merged
merged 1 commit into from
Sep 15, 2021

Conversation

hbagdi
Copy link
Contributor

@hbagdi hbagdi commented Sep 13, 2021

What type of PR is this?

/kind cleanup
/kind api-change
What this PR does / why we need it:

  • Add Filter prefix to the struct to match other filters
  • Rename Protocol to Scheme
  • Remove support levels on the fields since the filter is marked as Core

Which issue(s) this PR fixes:

None

Does this PR introduce a user-facing change?:

HTTPRequestRedirectFilter's Protocol field has been renamed to Scheme.

@k8s-ci-robot k8s-ci-robot added kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. kind/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Sep 13, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hbagdi

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 Sep 13, 2021
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 for the work on this @hbagdi! This LGTM except for removing the support levels.

// header in the response.
// When empty, the protocol of the request is used.
//
// Support: Extended
Copy link
Member

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 can remove the support levels here. I can't find/remember where this was documented, but I thought we agreed that support level was essentially a min of field and parent support level. This was particularly important for filters since they could be defined per Route Rule or per Backend. In this case, we'd be removing an "Extended" support annotation and deferring to the "Core" support of redirects in general which does not seem accurate here. This comment applies throughout, but just adding it here.

Copy link
Member

Choose a reason for hiding this comment

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

As a follow up, this PR recovers the docs that got lost around this: #864.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I expected some discussion on this front.

I'm a bit confused here so making sure I understand you right.

support level was essentially a min of field and parent support level

I think we agree with this statement. I removed the Extended support level because the filter is marked as "Core". Marking the filter as "Extended" is another option to adhere to this rule.

Or are you saying that we should keep the filter as "Core" and have some fields marked as "Extended" (leave as is)?
The concern I've with this approach is that as a user, I might get surprised when I'm using a Core filter with a conformant implementation but something doesn't work and the reason is a field-level documentation that I didn't peruse.

Copy link
Member

Choose a reason for hiding this comment

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

Although I agree this could get confusing, I think the alternatives are worse. The way I see it we have two options:

  1. Features can be marked core but may include some extended capabilities/fields that are not required to use the feature
  2. Features must be marked as extended if they include at least one field that is not supported by every implementation.

The current PR actually is more of a third option - it removes the "Extended" annotation on several fields, which may lead users to believe the field had "Core" support. Unfortunately there's at least one implementation that can't support the field, so that seems inaccurate.

Of the options I listed above, I strongly prefer 1 because otherwise I think we'd end up avoiding new fields or with a lot of "Extended" features.

Copy link
Contributor Author

@hbagdi hbagdi Sep 15, 2021

Choose a reason for hiding this comment

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

I think we'd end up avoiding new fields or with a lot of "Extended" features.

An alternative is to have a filter "RequestRedirectExtended" (with a better name) in addition to the core filter. That lays out the contract much more explicitly and makes the end-user experience free of confusion.
We can't take this approach with more involved features within the guts of the API, but with filters, we can.

Having said that, I've reverted the changes related to conformance levels to minimize the scope of the PR.

//
// +optional
// +kubebuilder:validation:Enum=HTTP;HTTPS
Protocol *string `json:"protocol,omitempty"`
Scheme *string `json:"scheme,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

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

While the protocol was "HTTP", I guess the scheme should be "http"?

- Add `Filter` prefix to the struct to match other filters
- Rename `Protocol` to `Scheme`
@robscott
Copy link
Member

Thanks!

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 15, 2021
@k8s-ci-robot k8s-ci-robot merged commit 8773914 into kubernetes-sigs:master Sep 15, 2021
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/api-change Categorizes issue or PR as related to adding, removing, or otherwise changing an API kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. 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
None yet
Development

Successfully merging this pull request may close these issues.

4 participants