Commit Graph

69 Commits

Author SHA1 Message Date
ahrtr
fe95aa614c io/ioutil has already been deprecated in golang 1.16, so replace all ioutil with io and os 2022-02-03 05:32:12 +08:00
Jeffrey Ying
ecb9b620fe
Revert "Populate OpenAPI in all integration tests" 2022-01-26 13:30:03 -05:00
Jefftree
eb8f6fe0f9 Populate OpenAPI in all integration tests 2022-01-25 14:16:31 -08:00
Kevin Delgado
e50e2bbc88 Server Side Field Validation
Implements server side field validation behind the
`ServerSideFieldValidation` feature gate. With the
feature enabled, any create/update/patch request
with the `fieldValidation` query param set to
"Strict" will error if the object in the request
body have unknown fields. A value of "Warn"
(also the default when the feautre is enabled)
will succeed the request with a warning.

When the feature is disabled (or the query param
has a value of "Ignore"), the request will succeed
as it previously had with no indications of any
unknown or duplicate fields.
2021-11-19 21:24:36 +00:00
Antonio Ojea
3ca2bb4443 integration test clientset share connection for custom transports 2021-10-20 06:39:39 +02:00
KeZhang
952aa1b2d2 add integration test for apiserver hsts 2021-08-05 10:41:52 +08:00
Mengjiao Liu
257b494478 test/integration: Rename masterConfig to instanceConfig 2021-06-08 17:21:47 +08:00
Mengjiao Liu
ac5535c949 test/integration: Rename MasterConfigOptions to ControlPlaneConfigOptions 2021-06-08 16:58:46 +08:00
Mengjiao Liu
6871b2b3c7 Rename masterConfig to controlPlaneConfig 2021-06-04 20:55:08 +08:00
Mengjiao Liu
387154f1a9 Part3: master to controlplane in test/integration
Rename RunAMaster to RunAControlPlane
2021-06-03 11:06:19 +08:00
Mengjiao Liu
c9ec486287 Part of master to controlplane in test/integration
Rename NewIntegrationTestMasterConfig to NewIntegrationTestControlPlaneConfig
2021-05-25 13:26:28 +08:00
Niekvdplas
fec272a7b2 Fixed several spelling mistakes 2021-03-30 23:02:09 +02:00
Kubernetes Prow Robot
7b0ad65d4d
Merge pull request #99288 from supriya-premkumar/ineffassign
Adds ineffassign to GO linter script.
2021-03-03 14:40:46 -08:00
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
David Eads
734e9b7dd6 fix up CRD validation tests 2021-03-02 14:34:41 -05:00
David Eads
06eb2f5d41 switch apiserver integration tests to CRD v1 2021-03-02 14:34:41 -05: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