Commit Graph

54 Commits

Author SHA1 Message Date
Supriya Premkumar
e52e5e486c
Adds ineffassign to GO linter script.
Changes:
 - Enables ineffassign check in the verify scripts.
 - Fixes lint errs.
2021-03-03 08:28:10 -08:00
Haowei Cai
7a6afe7989 make sure managedFields are written 2020-11-18 19:21:25 -08:00
Haowei Cai
8bcf34a203 unit and integration tests
apiserver dedups and adds warning in CREATE/UPDATE/PATCH requests;
also handles duplication caused by mutating admission.
2020-11-18 12:46:20 -08:00
Daniel Smith
15e0e3e90e rename 2020-09-02 10:48:26 -07:00
Jordan Liggitt
8f9be8af13 Stabilize integration test names 2020-07-22 11:58:54 -04:00
Jordan Liggitt
017a6febe5 Deflake TestListResourceVersion0 2020-07-01 13:59:40 -04:00
Joe Betz
e214f2408b Add ResourceVersionMatch parameter to make Resource Version semantics consistent for list 2020-06-25 20:49:57 -07:00
Davanum Srinivas
442a69c3bd
switch over k/k to use klog v2
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2020-05-16 07:54:27 -04:00
Jordan Liggitt
5efcc9e633 Restore cache-control header filter 2020-04-24 15:38:51 -04:00
Kubernetes Prow Robot
f52cbea102
Merge pull request #88910 from liggitt/metadata-context
Metadata client: plumb context
2020-03-06 13:18:04 -08:00
Jordan Liggitt
04a72d5ef9 client-go metadata: update callers 2020-03-06 11:07:54 -05:00
Jordan Liggitt
b7c2faf26c client-go dynamic client: add context to callers 2020-03-06 10:56:23 -05:00
Mike Danese
25651408ae generated: run refactor 2020-02-08 12:30:21 -05:00
Mike Danese
3aa59f7f30 generated: run refactor 2020-02-07 18:16:47 -08:00
wojtekt
5dcf08c199 Switch pager to return whether the result was paginated 2020-01-31 11:50:23 +01:00
Mike Danese
d55d6175f8 refactor 2020-01-29 08:50:45 -08:00
tanjunchen
06c5901769 fix staticcheck in test/integration/apiserver 2019-12-06 23:05:20 +08:00
wojtekt
54163527a6 Ensure conversions are registered for metainternalversion codecs 2019-09-12 19:32:02 +02:00
Jordan Liggitt
0feb99f9bd Remove unnecessary serializer override for CRD status, test proto requests on CRD status 2019-08-08 12:49:08 -04:00
Clayton Coleman
98d87a4f03
Rename metadata.NewConfigOrDie to be consistent
Updated name to match dynamic client
2019-07-11 12:18:51 -04:00
Kubernetes Prow Robot
4c68fa8243
Merge pull request #79239 from apelisse/400-instead-of-500
Return 400 on invalid patch requests
2019-07-10 21:39:20 -07:00
Antoine Pelisse
7e96438748 Return 400 on invalid patch requests 2019-07-10 15:22:10 -07:00
Clayton Coleman
21f5e643d9
Add a metadata client to client-go that can read PartialObjectMetadata
This client exposes operations on generic metadata (get, list, watch, delete)
and allows patch operations. The client always uses protobuf and requests
the server transform the response into the appropriate object. Using this
client simplifies the work of generic controllers by allowing them to treat
all objects the same, and also improves performance both in the amount of
data sent as well as allowing protobuf on CRD resources.
2019-07-02 16:42:41 -04:00
Clayton Coleman
26a6cdda86
Set integration tests to use distinct namespaces
TestWatchBasedManager was racing with the default namespace creation.
To fix that flake and to ensure integration tests using a shared etcd
don't accidentally overlap in the future, move the three main tests
using the default namespace to separate namespaces, and have
TestWatchBasedManager create that namespace before it runs.

Make StartTestServer wait for default namespace creation, which will
reduce other flakes until future changes completely remove use of default
namespace.

From a failed integration run:

	watch_manager_test.go:66: namespaces "default" not found
	watch_manager_test.go:66: namespaces "default" not found
	watch_manager_test.go:66: namespaces "default" not found
2019-05-30 19:11:50 -04:00
Clayton Coleman
89e752add0
CRDs should support watch of protobuf PartialObjectMetadata
Correctly ensure CRDs can be watched using protobuf when transformed to
PartialObjectMetadata. To do this we add a set of serializers allowed to
be used for "normal" requests (that return CRDs) while the serializers
supported by the infrastructure is broader and includes protobuf. During
negotatiation we check for transformation requests and protobuf is
excluded from non-transform requests.

As part of the change, correct an error message when the server returns
a 406 but the client doesn't accept the format to avoid confusing users
who set impossible Accept rules for CRDs (the dynamic client doesn't
support Protobuf, so if the server responds with a protobuf status the
message from the server is lost and the generic error was confusing).
2019-05-30 10:47:35 -04:00
Kubernetes Prow Robot
274876ef9a
Merge pull request #77448 from smarterclayton/api_serve
Support meta.k8s.io/v1 Table and PartialObjectMetadata requests to the API
2019-05-10 21:30:37 -07:00
Clayton Coleman
33a3e325f7
API server should offer metav1 Table/Partial transforms
Now that internal types are equivalent, allow the apiserver to serve
metav1 and metav1beta1 depending on the client. Test that in the
apiserver integration test and ensure we get the appropriate responses.

Register the metav1 type in the appropriate external locations.
2019-05-10 15:29:07 -04:00
Andrew Kim
c919139245 update import of generic featuregate code from k8s.io/apiserver/pkg/util/feature -> k8s.io/component-base/featuregate 2019-05-08 10:01:50 -04:00
wojtekt
b48cc43eff Cleanup content-type protobuf constants 2019-04-24 17:11:24 +02:00
Joe Betz
e5a4f09ab3 Add resourceVersion=0 paginated list integration test for disabled and enabled watch cache 2019-04-02 13:06:15 -07:00
Clayton Coleman
6825daa91a
Check CRD protobuf negotiation in integration tests
Add a few more tests to verify CRDs don't regress as client changes
are made.
2019-03-22 13:14:46 -04:00
Clayton Coleman
3230a0b4fd
Support Table and PartialObjectMetadata on watch
Clean up the code paths that lead to objects being transformed and output with negotiation.
Remove some duplicate code that was not consistent. Now, watch will respond correctly to
Table and PartialObjectMetadata requests. Add unit and integration tests.

When transforming responses to Tables, only the first watch event for a given type will
include the columns. Columns will not change unless the watch is restarted.

Add a volume attachment printer and tighten up table validation error cases.

Disable protobuf from table conversion because Tables don't have protobuf because they
use `interface{}`
2019-03-08 13:03:59 -05:00
Antoine Pelisse
0e1d50e70f API Machinery, Kubectl and tests 2019-02-04 13:51:48 -08:00
Jordan Liggitt
b64075dbd0 explicitly enable apps/v1beta1, apps/v1beta2, extensions/v1beta1 for print,etcd,storage tests 2019-01-24 21:43:15 -05:00
Jordan Liggitt
4fc63fd014 use apps/v1 APIs in integration tests 2019-01-24 21:34:12 -05:00
Weibin Lin
842bd1e1ec update deployment, daemonset, replicaset, statefulset to apps/v1 2018-12-19 10:46:45 -05:00
Jordan Liggitt
4dca07ef7e Fixup incorrect use of DefaultFeatureGate.Set in tests 2018-11-21 11:51:33 -05:00
Davanum Srinivas
954996e231
Move from glog to klog
- Move from the old github.com/golang/glog to k8s.io/klog
- klog as explicit InitFlags() so we add them as necessary
- we update the other repositories that we vendor that made a similar
change from glog to klog
  * github.com/kubernetes/repo-infra
  * k8s.io/gengo/
  * k8s.io/kube-openapi/
  * github.com/google/cadvisor
- Entirely remove all references to glog
- Fix some tests by explicit InitFlags in their init() methods

Change-Id: I92db545ff36fcec83afe98f550c9e630098b3135
2018-11-10 07:50:31 -05:00
wojtekt
f344c5c062 Requires single name for list and watch 2018-05-15 14:19:21 +02:00
David Eads
ee5bc39c4c remove kube-apiserver option that is always force to true 2018-04-02 12:19:34 -04:00
Maciej Szulik
1b5f38293f
Add integration test for server side printing 2018-02-28 17:27:48 +01:00
supereagle
9c02d7e38c use extensions client with explicit version 2017-11-22 21:18:14 +08:00
Dr. Stefan Schimanski
012b085ac8 pkg/apis/core: mechanical import fixes in dependencies 2017-11-09 12:14:08 +01:00
Dr. Stefan Schimanski
7d09148ad7 apiserver: separate apiserver specific configs into ExtraConfig 2017-09-08 14:16:09 +02:00
Clayton Coleman
91527b9809
Integration test for API paging 2017-09-01 10:47:01 -04:00
Jacob Simpson
8bcbbd4d08 Migrate api.Registry to testapi.Groups in tests. 2017-07-17 15:05:38 -07:00
Jacob Simpson
29c1b81d4c Scripted migration from clientset_generated to client-go. 2017-07-17 15:05:37 -07:00
Chao Xu
60604f8818 run hack/update-all 2017-06-22 11:31:03 -07:00
Chao Xu
cde4772928 run ./root-rewrite-all-other-apis.sh, then run make all, pkg/... compiles 2017-06-22 11:30:52 -07:00
Chao Xu
f4989a45a5 run root-rewrite-v1-..., compile 2017-06-22 10:25:57 -07:00