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

fix(gatewayapi): correctly handle invalid backendRefs #6428

Merged

Conversation

michaelbeaumont
Copy link
Contributor

@michaelbeaumont michaelbeaumont commented Mar 31, 2023

The idea here is to configure a reference to a cluster that doesn't exist and let Envoy return a 500 error.

A different option would be to mark a backend explicitly as missing endpoints, as opposed to a special tag value:

backends:
  - unresolvedEndpoints: true
  - destination:
      kuma.io/service: some-working-backend

Changelog: fix(GatewayAPI): correctly handle invalid backendRefs

Checklist prior to review

  • Link to relevant issue as well as docs and UI issues -- Closes Gateway API v0.5.0 conformance #4597
  • This will not break child repos: it doesn't hardcode values (.e.g "kumahq" as a image registry) and it will work on Windows, system specific functions like syscall.Mkfifo have equivalent implementation on the other OS --
  • Tests (Unit test, E2E tests, manual test on universal and k8s) --
  • Do you need to update UPGRADE.md? --
  • Does it need to be backported according to the backporting policy? --
  • Do you need to explicitly set a > Changelog: entry here or add a ci/ label to run fewer/more tests?

Signed-off-by: Mike Beaumont <mjboamail@gmail.com>
@michaelbeaumont michaelbeaumont added the ci/run-full-matrix PR: Runs all possible e2e test combination (expensive use carefully) label Mar 31, 2023
Signed-off-by: Mike Beaumont <mjboamail@gmail.com>
Signed-off-by: Mike Beaumont <mjboamail@gmail.com>
Signed-off-by: Mike Beaumont <mjboamail@gmail.com>
@michaelbeaumont michaelbeaumont force-pushed the feat/gateway_conformance_0.5.0 branch from deba808 to 6a2695b Compare March 31, 2023 15:23
@michaelbeaumont michaelbeaumont marked this pull request as ready for review March 31, 2023 16:09
@michaelbeaumont michaelbeaumont requested review from a team, lobkovilya and lukidzi and removed request for a team March 31, 2023 16:09
Copy link
Contributor

@lahabana lahabana left a comment

Choose a reason for hiding this comment

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

LGTM though I'm a little surprised such a value is accepted as a tag value.

@michaelbeaumont
Copy link
Contributor Author

michaelbeaumont commented Apr 3, 2023

LGTM though I'm a little surprised such a value is accepted as a tag value.

Yeah, you're right. It's because we validate destination as selectors, not tags, and selectors can contain slashes. Perhaps especially kuma.io/service should be more strictly validated here, it doesn't make sense for it to be *, for example.

@michaelbeaumont
Copy link
Contributor Author

I'm going to merge this. We can potentially discuss validation later

@michaelbeaumont michaelbeaumont merged commit 97552c1 into kumahq:master Apr 3, 2023
@michaelbeaumont michaelbeaumont deleted the feat/gateway_conformance_0.5.0 branch April 3, 2023 11:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci/run-full-matrix PR: Runs all possible e2e test combination (expensive use carefully)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gateway API v0.5.0 conformance
3 participants