Commit Graph

11 Commits

Author SHA1 Message Date
Clayton Coleman ce019febe3 Move unstructured conversion into pkg/runtime
Scheme conversion should support unstructured conversion natively to
allow going from unstructured to typed and back. It is not a higher
level responsibility to do that conversion because the scheme is the
only one who knows what types it supports.

Kubernetes-commit: 557f9ddfe6300ecdbdd70ea67dca63bf6b710ea7
2017-11-13 21:28:57 -05:00
Dr. Stefan Schimanski 441ac63056 admission: complete plumbing of validation admission
Kubernetes-commit: 74b4223ab80fa3bbf326ac1073ef28f0b8daa304
2017-10-24 14:08:34 +02:00
Nikhita Raghunath eb855aac8e Fix error for strategic merge patch of custom resources
We need the go struct tags `patchMergeKey` and `patchStrategy`
for fields that support a strategic merge patch. For native
resources, we can easily figure out these tags since we know
the fields.

Because custom resources are decoded as Unstructured and
because we're missing the metadata about how to handle
each field in a strategic merge patch, we can't find the
go struct tags. Hence, we can't easily  do a strategic merge
for custom resources.

So we should fail fast and return an error.

Kubernetes-commit: 79349c93bddcc1125a9d6ea4528c6d63b172f083
2017-10-07 17:29:19 +05:30
Nikhita Raghunath 6f448f398c apiserver: return 4xx for invalid patch
Add interpretPatchError to return appropriate http code
(400 or 422) according to the error type.

We add this function in apiserver because we don't want
to mention the http code in apimachinery. The apimachinery
code is also used in kubectl. The client should not return
a server error.

Add a test to validate the http error code and error message.

Kubernetes-commit: e0a2168ecbf8b4e43f932a32fa55cd55215123cc
2017-10-24 17:26:03 +05:30
David Eads a0a5b2c568 split up large rest handling file
Kubernetes-commit: cd663d7ad00937cffa8a09e4761acb95d34c89a3
2017-10-18 16:04:33 -04:00
Mikhail Mazurskiy 7039fe1e17 Refactor unstructured converter
Kubernetes-commit: dc1ee493a29251492403e4282b5df3e897de2214
2017-06-30 08:44:46 +00:00
Jordan Liggitt fa876f6773 Fix original object mutation on patch retry
Kubernetes-commit: c415e4aeabe5e5514dcdbf2c01c533533c25f4c1
2017-04-06 20:35:16 +00:00
Jordan Liggitt 8543f589d2 Ensure patched objects are defaulted correctly
Kubernetes-commit: 464db160b410b22dba53af6d11fa097f0fa4fd6b
2017-03-18 19:56:09 +00:00
ymqytw 7306f452f2 switch to k8s json to avoid number conversion issue
Kubernetes-commit: b29f4c26d799dca6606b45a0e03f7f931abcdefc
2017-03-18 19:56:09 +00:00
Wojciech Tyczynski 63e29dca6f Use new runtime.Object <-> map[string]interface{} converter 2017-02-27 15:10:34 -05:00
Dr. Stefan Schimanski f3c3e07241 Mechanical move: pkg/genericapiserver -> k8s.io/apiserver 2017-02-13 07:36:41 -05:00