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(api-server): return 400 on invalid resource name #5719

Merged
merged 1 commit into from
Jan 17, 2023

Conversation

lahabana
Copy link
Contributor

Before we were returning 500 when resource was not in the format <name>.<namespace>
We now return a typed error in the store and have the api-server map the error to a 400

Fix #5705
Fix #4985

Signed-off-by: Charly Molter [email protected]

Checklist prior to review

  • Link to docs PR or issue --
  • Link to UI issue or PR --
  • Is the issue worked on linked? --
  • The PR does not hardcode values that might break projects that depend on kuma (e.g. "kumahq" as a image registry) --
  • The PR will work for both Linux and Windows, system specific functions like syscall.Mkfifo have equivalent implementation on the other OS --
  • Unit Tests --
  • E2E Tests --
  • Manual Universal Tests --
  • Manual Kubernetes Tests --
  • 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?

@lahabana lahabana requested review from a team, lobkovilya and lukidzi and removed request for a team January 16, 2023 15:05
Copy link
Contributor

@jakubdyszkiewicz jakubdyszkiewicz left a comment

Choose a reason for hiding this comment

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

I miss the test of API that we map precondition error to 400

Before we were returning 500 when resource was not in the format
`<name>.<namespace>`
We now return a typed error in the store and have the api-server map the
error to a 400

Fix kumahq#5705
Fix kumahq#4985

Signed-off-by: Charly Molter <[email protected]>
@lahabana
Copy link
Contributor Author

added a simple e2e test. Unit test was much trickier

@lahabana lahabana merged commit 5893f2d into kumahq:master Jan 17, 2023
@lahabana lahabana deleted the fix5705 branch May 2, 2023 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants