gateway-api icon indicating copy to clipboard operation
gateway-api copied to clipboard

Clarify whether an http redirect is conditional or unconditional

Open pleshakov opened this issue 3 years ago • 1 comments
trafficstars

What would you like to be added:

In the redirect examples here https://gateway-api.sigs.k8s.io/guides/http-redirect-rewrite/#redirects the backendRefs are always configured. Like below:

. . .
  rules:
    - filters:
      - type: RequestRedirect
        requestRedirect:
          scheme: https
          statusCode: 301
      backendRefs:
      - name: example-svc
        weight: 1
        port: 80

If the redirect is unconditional (always fires), then the backendRefs are unnecessary, because the proxy will never proxy to the backends.

However, if the redirect is conditional, then the backendRefs are OK. However, I think it make sense to clarify in the examples when the redirect will not fire and why the backendRefs are needed. Also, I think it makes sense to clarify that in the docs https://github.com/kubernetes-sigs/gateway-api/blob/a7a465ababc8b7c2cd9eaa1ab769496704fee92a/apis/v1beta1/httproute_types.go#L819

Why this is needed:

  • to ensure consistent behavior across implementations
  • to make the documentation clearer.

See also:

  • loop protection proposal -- https://github.com/kubernetes-sigs/gateway-api/issues/1185
  • a related discussion about redirect behavior -- https://github.com/kubernetes-sigs/gateway-api/discussions/1360

pleshakov avatar Aug 31 '22 01:08 pleshakov

I think it makes sense +1.

tokers avatar Aug 31 '22 01:08 tokers

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

k8s-triage-robot avatar Nov 29 '22 02:11 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle rotten

k8s-triage-robot avatar Dec 29 '22 03:12 k8s-triage-robot

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

k8s-triage-robot avatar Jan 28 '23 04:01 k8s-triage-robot

@k8s-triage-robot: Closing this issue, marking it as "Not Planned".

In response to this:

The Kubernetes project currently lacks enough active contributors to adequately respond to all issues and PRs.

This bot triages issues according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Reopen this issue with /reopen
  • Mark this issue as fresh with /remove-lifecycle rotten
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/close not-planned

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 avatar Jan 28 '23 04:01 k8s-ci-robot