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

Make RESTful operations return 404 Not Found when the target resource does not exist. #486

Merged
merged 1 commit into from
Jul 18, 2014

Conversation

yugui
Copy link
Contributor

@yugui yugui commented Jul 16, 2014

In the original implementation, GET, DELETE and PUT operations on
non-existent resources used to return 500 but not 404.

// RESTStorage is a generic interface for RESTful storage services
// Storages whicih are exported to the RESTful API of apiserver need to implement this interface.
Copy link
Contributor

Choose a reason for hiding this comment

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

"Resources which are exported ..."

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done.

@yugui
Copy link
Contributor Author

yugui commented Jul 17, 2014

PTAL

@smarterclayton
Copy link
Contributor

LGTM

@lavalamp
Copy link
Member

I'm OK with this, as long as there's the understanding that we'll change it to an error type that carries a suggested HTTP response code with it. I don't want to make an error type for every possible return value and use a switch to decide what to return. I actually was moving in that direction with the api.Status struct, which has a "Code" field for that purpose, and the client already has a StatusError type...

Please squash before we commit, though!

@smarterclayton
Copy link
Contributor

@lavalamp - agree, an error associated with a "rest storage" interface should logically match REST error conditions as much as possible.

does not exist.

In the original implementation, GET, DELETE and PUT operations on
non-existent resources used to return 500 but not 404.
@yugui
Copy link
Contributor Author

yugui commented Jul 18, 2014

Squashed.

lavalamp added a commit that referenced this pull request Jul 18, 2014
Make RESTful operations return 404 Not Found when the target resource does not exist.
@lavalamp lavalamp merged commit 2188907 into kubernetes:master Jul 18, 2014
@lavalamp
Copy link
Member

Thanks for the change!

@yugui yugui deleted the fix/404-if-notfound branch July 19, 2014 05:23
vishh added a commit to vishh/kubernetes that referenced this pull request Apr 6, 2016
Specify that stats writing continued in error.
wking pushed a commit to wking/kubernetes that referenced this pull request Jul 21, 2020
b3atlesfan pushed a commit to b3atlesfan/kubernetes that referenced this pull request Feb 5, 2021
Makefile: Disable static builds of flanneld
jsafrane pushed a commit to jsafrane/kubernetes that referenced this pull request Mar 1, 2021
…rry-pick-481-to-release-4.6

Bug 1907461: kubelet: do not rerun init containers if any main containers have status
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants