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

Move error status code from 404 to 500 #1208

Merged
merged 1 commit into from
Jun 14, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions apis/v1alpha2/httproute_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ type HTTPRouteRule struct {
// BackendRefs defines the backend(s) where matching requests should be
// sent.
//
// A 404 status code MUST be returned if there are no BackendRefs or filters
// A 500 status code MUST be returned if there are no BackendRefs or filters
// specified that would result in a response being sent.
//
// A BackendRef is considered invalid when it refers to:
Expand All @@ -212,11 +212,11 @@ type HTTPRouteRule struct {
// * a resource in another namespace when the reference has not been
// explicitly allowed by a ReferenceGrant (or equivalent concept).
//
// When a BackendRef is invalid, 404 status codes MUST be returned for
// When a BackendRef is invalid, 500 status codes MUST be returned for
// requests that would have otherwise been routed to an invalid backend. If
// multiple backends are specified, and some are invalid, the proportion of
// requests that would otherwise have been routed to an invalid backend
// MUST receive a 404 status code.
// MUST receive a 500 status code.
//
// When a BackendRef refers to a Service that has no ready endpoints, it is
// recommended to return a 503 status code.
Comment on lines 221 to 222
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this have been changed to 500 too?

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 agree, seems we should update here as well.
@robscott should I make the PR to change this status code 503 -> 500 as well?

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 the PR for that: #1210

Expand Down
6 changes: 3 additions & 3 deletions apis/v1beta1/httproute_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ type HTTPRouteRule struct {
// BackendRefs defines the backend(s) where matching requests should be
// sent.
//
// A 404 status code MUST be returned if there are no BackendRefs or filters
// A 500 status code MUST be returned if there are no BackendRefs or filters
// specified that would result in a response being sent.
//
// A BackendRef is considered invalid when it refers to:
Expand All @@ -211,11 +211,11 @@ type HTTPRouteRule struct {
// * a resource in another namespace when the reference has not been
// explicitly allowed by a ReferenceGrant (or equivalent concept).
//
// When a BackendRef is invalid, 404 status codes MUST be returned for
// When a BackendRef is invalid, 500 status codes MUST be returned for
// requests that would have otherwise been routed to an invalid backend. If
// multiple backends are specified, and some are invalid, the proportion of
// requests that would otherwise have been routed to an invalid backend
// MUST receive a 404 status code.
// MUST receive a 500 status code.
//
// When a BackendRef refers to a Service that has no ready endpoints, it is
// recommended to return a 503 status code.
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions config/crd/standard/gateway.networking.k8s.io_httproutes.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.