Commit Graph

67 Commits

Author SHA1 Message Date
Ben Luddy
a77f4c7ba2 Fix content type fallback when a client defaults to CBOR.
With the ClientsAllowCBOR client-go feature gate enabled, a 415 response to a CBOR-encoded REST
causes all subsequent requests from the client to fall back to a JSON request encoding. This
mechanism had only worked as intended when CBOR was explicitly configured in the
ClientContentConfig. When both ClientsAllowCBOR and ClientsPreferCBOR are enabled, an
unconfigured (empty) content type defaults to CBOR instead of JSON. Both ways of configuring a
client to use the CBOR request encoding are now subject to the same fallback mechanism.
2024-11-07 09:14:59 -05:00
Ben Luddy
439d2f7b40 Wire serving codecs to CBOR feature gate.
Integration testing has to this point relied on patching serving codecs for built-in APIs. The
test-only patching is removed and replaced by feature gated checks at runtime.
2024-11-06 15:41:39 -05:00
Ben Luddy
504f14998e Use application/cbor-seq media type in streaming CBOR responses.
The media type application/cbor describes exactly one encoded item. As a new (to Kubernetes) format
with no existing clients, streaming/watch responses will use the application/cbor-seq media
type. CBOR watch responses conform to the specification of CBOR Sequences and are encoded as the
concatenation of zero or more items with no additional framing.
2024-11-06 08:23:18 -05:00
Ben Luddy
072dfcb416 Add CBOR feature gates.
For alpha, there is one apiserver feature gate and two client-go feature gates controlling
CBOR. They were initially wired to separate test-only feature gate instances in order to prevent
them from being configurable at runtime via command-line flags or environment variables (for
client-go feature gates outside of Kubernetes components). All of the integration tests required by
the KEP as alpha criteria have been implemented. This adds the feature gates to the usual feature
gate instances and removes the temporary code to support separate test-only feature gate instances.
2024-11-05 14:17:52 -05:00
Ben Luddy
1745dfdd15 Fall back to JSON request encoding after CBOR 415.
If a client is configured to encode request bodies to CBOR, but the server does not support CBOR,
the server will respond with HTTP 415 (Unsupported Media Type). By feeding this response back to the
RESTClient, subsequent requests can fall back to JSON, which is assumed to be acceptable.
2024-11-01 12:54:04 -04:00
Ben Luddy
37ed906a33 Support application/apply-patch+cbor in patch requests. 2024-10-30 12:21:15 -04:00
Ben Luddy
f831368428 Test response content negotiation with CBOR enablement. 2024-10-28 19:21:21 -04:00
Ben Luddy
67b9dc1f3e Wire client feature gates affecting RESTClient content config. 2024-10-28 13:15:28 -04:00
Richa Banker
9274a584b8 Split k8s.io/component-base/registry and add into k8s.io/component-base/version and k8s.io/component-base/featuregate 2024-10-24 19:09:30 -07:00
Richa Banker
81cd728c66 Move k8s.io/apiserver/pkg/util/version to component-base 2024-10-22 13:03:42 -07:00
Siyuan Zhang
4352c4ad27 Add version mapping in ComponentGlobalsRegistry.
Signed-off-by: Siyuan Zhang <sizhang@google.com>
2024-06-25 22:12:11 +00:00
Antonio Ojea
6552f2710f use default flags for apiserver on integration tests 2024-06-04 22:09:35 +00:00
Yuan Chen
a24aef6510 Replace a function closure
Replace more closures with pointer conversion

Replace deprecated Int32Ptr to Int32
2023-02-27 09:13:36 -08:00
Wojciech Tyczyński
41ee6a3e44 Remove selflink integration tests 2022-02-14 11:11:56 +01:00
Jiahui Feng
c56bbda368 fix containers order after applying
to be appending instead of prepending.
2022-01-14 11:15:54 -08:00
Jordan Liggitt
88ab0d03b7 Revert "update expected ordering"
This reverts commit fbc8ac9c96.
2021-11-24 11:19:27 -05:00
Jiahui Feng
fbc8ac9c96 update expected ordering
in apply test.
2021-11-02 10:00:00 -07:00
h4ghhh
0734820279 'New' Event namespace validate failed (#100125) 2021-09-16 04:29:45 -07:00
Joe Betz
d01788cd56 Enable extract test for status subresource 2021-04-22 15:32:45 -07:00
Antoine Pelisse
e477c31307 fieldmanager: Comment test broken by status being separated from main resource 2021-04-16 14:26:05 -07:00
Joe Betz
987657a80f Add extract apply function generation 2021-03-10 06:13:51 -08:00
Joe Betz
0b42cae157 Add integration test 2021-03-06 20:50:52 -05:00
wojtekt
2539912a22 Stop setting SelfLink in kube-apiserver. 2020-09-01 20:57:38 +02: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
Mike Danese
d55d6175f8 refactor 2020-01-29 08:50:45 -08:00
SataQiu
17b0b77026 fix staticcheck failures of test/integration/client test/integration/disruption 2020-01-03 17:23:35 +08:00
Han Kang
866ea74326 remove pkg/version and some of redundant copies of it
Change-Id: Ia58367c1b1274bfb49c8a4784051463abaf795de
2019-09-16 16:24:35 -07:00
Yassine TIJANI
bfa12a0992 add integration test for core/v1beta1 event compatibility
Signed-off-by: Yassine TIJANI <ytijani@vmware.com>
2019-05-30 15:01:15 +00:00
xuzhonghu
b7f645a5ef replace framework.RunAMaster with kubeapiservertesting.StartTestServer 2018-07-28 10:33:39 +08:00
David Eads
94e3d94d67 update tests to be specific about the versions they are testing instead of floating 2018-05-01 13:18:41 -04:00
Jordan Liggitt
fbd6f38084 collapse patch conflict retry onto GuaranteedUpdate
builds on #62868

1. When the incoming patch specified a resourceVersion that failed as a precondition,
the patch handler would retry uselessly 5 times. This PR collapses onto GuaranteedUpdate,
which immediately stops retrying in that case.

2. When the incoming patch did not specify a resourceVersion, and persisting to etcd
contended with other etcd updates, the retry would try to detect patch conflicts with
deltas from the first 'current object' retrieved from etcd and fail with a conflict error
in that case. Given that the user did not provide any information about the starting version
they expected their patch to apply to, this does not make sense, and results in arbitrary
conflict errors, depending on when the patch was submitted relative to other changes made
to the resource. This PR changes the patch application to be performed on the object retrieved
from etcd identically on every attempt.

fixes #58017
SMP is no longer computed for CRD objects

fixes #42644
No special state is retained on the first attempt, so the patch handler correctly handles
the cached storage optimistically trying with a cached object first
2018-04-25 21:55:13 -04:00
Manjunath A Kumatagi
1bb810e749 Use pause manifest image 2018-04-06 11:00:50 +05:30
Di Xu
48388fec7e fix all the typos across the project 2018-02-11 11:04:14 +08:00
Kevin
4c8539cece use core client with explicit version globally 2017-10-27 15:48:32 +08:00
Dr. Stefan Schimanski
7773a30f67 pkg/api/legacyscheme: fixup imports 2017-10-18 17:23:55 +02: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
Clayton Coleman
b6d9815b95 Remove use of (Label|Field)SelectorParam 2017-07-16 15:56:11 -04:00
Chao Xu
60604f8818 run hack/update-all 2017-06-22 11:31:03 -07:00
Chao Xu
f4989a45a5 run root-rewrite-v1-..., compile 2017-06-22 10:25:57 -07:00
deads2k
be39283923 plumb stopch to post start hook index since many of them are starting go funcs 2017-05-11 09:16:13 -04:00
Mike Danese
0c80a7aa40 fix go vet's from skipped tests 2017-04-28 14:19:40 -07:00
Mike Danese
21617a60ae don't use build tags to mark integration tests 2017-04-28 14:19:39 -07:00
deads2k
5fd0162a8a deflake TestPatch by waiting for cache 2017-03-07 08:53:29 -05:00
deads2k
ea887557d3 show patch error as string not byte slice 2017-03-01 11:32:16 -05:00
Jordan Liggitt
7b6ef2cedc Switch watch prefixes to params 2017-02-22 08:54:08 -05:00
Wojciech Tyczynski
a21b08d00f Revert "Use watch param instead of deprecated /watch/ prefix" 2017-02-21 08:37:51 +01:00
Jordan Liggitt
f950171003 Switch watch prefixes to params 2017-02-19 23:51:58 -05:00
Clayton Coleman
469df12038 refactor: move ListOptions references to metav1 2017-01-23 17:52:46 -05:00