Commit Graph

73 Commits

Author SHA1 Message Date
Cao Shufeng 35655c329b [trival]remove duplicated code from unit test
Kubernetes-commit: acb90b6547e0d8304a0f75bf21b9769c5186cf5d
2017-11-05 15:02:41 +08: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
Dr. Stefan Schimanski 3cfc602704 apimachinery: mechanical removal of ObjectCopier plumbing
Kubernetes-commit: 509df603b18d356777176953e5d160b6f3d0bba9
2017-10-06 13:30:12 +02:00
Dr. Stefan Schimanski 36b2f4560f deepcopy: add interface deepcopy funcs
- add DeepCopyObject() to runtime.Object interface
- add DeepCopyObject() via deepcopy-gen
- add DeepCopyObject() manually
- add DeepCopySelector() to selector interfaces
- add custom DeepCopy func for TableRow.Cells

Kubernetes-commit: 39d95b9b065fffebe5b6f233d978fe1723722085
2017-07-19 03:49:08 +00:00
Dr. Stefan Schimanski 5c33fc4de4 apimachinery: remove unneeded GetObjectKind() impls
Kubernetes-commit: da3322c2d93671b7cbff9b090dd5e1ce9984130e
2017-07-16 04:08:42 +00:00
Wojciech Tyczynski 1d0b329280 Pass RequestInfo to GenerateLink
Kubernetes-commit: b4018f7da18f1e61e59c5c48cae4178db2714f85
2017-06-13 20:47:27 +00:00
Wojciech Tyczynski d82b8bc329 Pass Context to GenerateLink
Kubernetes-commit: 25f0fe1adb199697565487b9dfacc4ed8ecdccbb
2017-06-13 20:47:27 +00:00
yupengzte e701e40544 format re
Signed-off-by: yupengzte <yu.peng36@zte.com.cn>

Kubernetes-commit: 9eee70656fc411029c91edafdbfa327eb0736528
2017-05-20 17:28:13 +00:00
nikhiljindal 404503d3e6 Updating generic registry to return UID while deleting the object
Kubernetes-commit: 44fc88cecd5ab175fe7907eb7b975f0a00cb2305
2017-05-16 17:27:51 +00:00
Chao Xu e46eb82a82 remove invocation of k8s.io/client-go/pkg/api/install
change import of client-go/api/helper to kubernetes/api/helper

remove unnecessary use of client-go/api.registry

change use of client-go/pkg/util to kubernetes/pkg/util

remove dependency on client-go/pkg/apis/extensions

remove unnecessary invocation of k8s.io/client-go/extension/intsall

change use of k8s.io/client-go/pkg/apis/authentication to v1

Kubernetes-commit: c354076aa41e3cf417b291d5f0eff2b70395ac30
2017-05-13 17:27:42 +00:00
Dr. Stefan Schimanski 21f84e3d21 apiserver: split endpoint tests from client-go
Kubernetes-commit: 67ca42b2d7e9efb5701618fb3d7faa62c53101c5
2017-05-02 20:36:05 +00:00
Anthony Yeh 9841cf11a1 PATCH: Fix erroneous meaningful conflict for numeric values.
The wrong json package was used, resulting in patches being unmarshaled
with numbers as float64 rather than int64.
This in turn confused HasConflicts() which expects numeric types to match.

The end result was false positives of meaningful conflicts, such as:

```
there is a meaningful conflict (firstResourceVersion: "8517",
currentResourceVersion: "8519"):
 diff1={"metadata":{"resourceVersion":"8519"},"spec":{"replicas":0},"status":{"conditions":null,"fullyLabeledReplicas":null,"replicas":0}}
, diff2={"spec":{"replicas":0}}
```

Kubernetes-commit: 1ab6a33db486adc060e1b63eecbdc06aabdde1f6
2017-04-24 20:36:05 +00:00
deads2k d3546820d7 remove go-restful from namer for rest handling
Kubernetes-commit: da27957390b99c3053922e75f220a8b09c20d7f6
2017-04-10 20:35:11 +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
deads2k 1e2d8fe122 remove cycle that snuck into tests 2017-02-23 09:48:09 -05:00
Dr. Stefan Schimanski 73c30cda7e staging/src/*: run gofmt 2017-02-23 09:48:09 -05:00
Dr. Stefan Schimanski a372fcad62 Mechanical fixup imports: pkg/genericapiserver 2017-02-13 07:36:41 -05:00
Dr. Stefan Schimanski f3c3e07241 Mechanical move: pkg/genericapiserver -> k8s.io/apiserver 2017-02-13 07:36:41 -05:00