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
API Conventions: PUT does not create new resource #876
Comments
Sadly: |
Issues go stale after 90d of inactivity. Prevent issues from auto-closing with an If this issue is safe to close now please do so with Send feedback to sig-testing, kubernetes/test-infra and/or |
/remove-lifecycle stale |
Any news? |
the mentioned doc is now at https://github.com/kubernetes/community/blob/master/contributors/devel/sig-architecture/api-conventions.md#verbs-on-resources Some resources support create on update (PUT), but it is not consistent, only these allow it:
The documentation should clarify that support for create via PUT is resource-specific. With server-side apply, all resources support create-or-update via PATCH with the server-side apply content type. Clients wanting to collapse to a single API request that will create if needed should use that mechanism. @apelisse, is that aspect highlighted in SSA docs? That patch type could be added to this doc and the create-on-update aspect mentioned |
I was looking at SSA page and it's not that great with that regard. This point is mentioned in that pull-request though:
|
/area contributor-guide |
Is there any new news on this issue? |
According to HTTP Verbs section of the API conventions documentation, using the HTTP Verb
PUT
, we can update or create a resource if it does not exist.However, this doesn't seem to reflect reality. It might be true only for specific resources and endpoints, but we cannot seem to create a resource of type
Deployment
using the Kubernetes API on a Minikube test setup: (tested with Kubernetes Version 1.5.3 and 1.7.0)Consider the following request:
This request fails if the resource does not exist. It succeeds if the resource has previously been created. Using
PUT
does therefore not seem to 'Create or Update a Resource', but rather only 'Update a Resource'.Is the documentation incorrect or does it for some reason not apply to the resource type
Deployments
? (We have also tested withServices
and seen the same behavior).Thanks for your help.
The text was updated successfully, but these errors were encountered: