Commit Graph

3957 Commits

Author SHA1 Message Date
Jordan Liggitt c8c846aeb1 Plumb effective version into admission initializer
Kubernetes-commit: 55419eca7a203e6f251fa632686bd4f534bf12e8
2025-07-28 16:48:28 -04:00
Marek Siarkowicz b5a6bf9a62 Test requests send to etcd for all LIST requests
Kubernetes-commit: 709280ef6e785196c62ce73d65d0ddc7b4dca718
2025-06-12 14:50:23 +02:00
Marek Siarkowicz c057db759a Ensure keys used in storage and cacher start with resourcePrefix
Kubernetes-commit: 6d5aece4d81cc2b23308dd034d0c9276feb5cc55
2025-09-11 13:42:19 +02:00
Marek Siarkowicz ce9b4fddcb Extract the prepareKey function
Kubernetes-commit: 0b10735cd72fbf5416a20d2bb7e525b7d8a1e716
2025-09-17 16:41:27 +02:00
Marek Siarkowicz 9d438d9fe5 Ensure consistent key schema requirements between cacher and etcd3
Kubernetes-commit: 91a3a30eb5ca401ca700cb42cea416d83750cade
2025-09-15 14:18:03 +02:00
Marek Siarkowicz 35644ed688 Unify directory protection for recursive requests in storage
Kubernetes-commit: 74faf1527fd444b90e5f5622b440c17ac96bc166
2025-09-15 13:46:43 +02:00
Lalit Chauhan 44ba29e9b1 Add fine grained metrics to narrow down DV mismatches and panics
Kubernetes-commit: 1a5e77135b2c35c17dea3a85b753ab4a5f133387
2025-09-08 18:48:04 +00:00
Richa Banker 3218fe46fe Specify the deprecated version of apiserver_storage_objects metric
Kubernetes-commit: 476325f6e5febeb1c5beb673aa01474518310811
2025-09-11 16:16:20 -07:00
Marek Siarkowicz 73c7acd623 Fix cacher resource prefix not having a "/" at the end in tests
Kubernetes-commit: 1e742f01ba6749bf7e356097c034c8cf9eb56d85
2025-09-11 15:03:05 +02:00
Marek Siarkowicz 9e9ff9a0ae Fix flaking RunTestDelayedWatchDelivery
Kubernetes-commit: 1baa7936d893e39dd42cec3de1c025c5313bd07e
2025-08-20 14:10:33 +02:00
Joe Betz 6e4abd889d Update tests that depend on internal model names
Signed-off-by: Joe Betz <jpbetz@google.com>

Kubernetes-commit: fc091d93d53d8b69cae42b25c0b8da70d0263f80
2025-09-10 15:52:59 -04:00
Joe Betz f0b7032c0a stop using util.ToRESTFriendlyName in favor of declared model names
Signed-off-by: Joe Betz <jpbetz@google.com>

Kubernetes-commit: 3fc59ee9a70098e328d79b41f99178f9708054d5
2025-09-10 15:52:59 -04:00
Joe Betz 1dcb41b59f generate
Signed-off-by: Joe Betz <jpbetz@google.com>

Kubernetes-commit: 5647c07179df7df9ae6775f3f7692462db93d68b
2025-09-10 15:52:58 -04:00
Joe Betz 5ef311f08b Add model name generator tags
Signed-off-by: Joe Betz <jpbetz@google.com>

Kubernetes-commit: e910c181cb9a91cd01a73869921ee285377aea61
2025-09-10 15:52:58 -04:00
Marek Siarkowicz 549d9cb681 Fix tests not using proper resource paths
Kubernetes-commit: 4f6598e8a31558f253109351a36e9a72d0d78ab7
2025-09-11 12:23:35 +02:00
Marek Siarkowicz 677aaf0c38 Fix tests to to only accesses keys from under resourcePrefix
Kubernetes-commit: 1ac067ae0e68b14a7a6eff464aacdaf7d70e838d
2025-09-03 12:23:07 +02:00
Anish Ramasekar 6065eecf08 kmsv2: run TestKMSv2ProviderKeyIDStaleness in parallel
This change updates the NowFunc to be per KMS provider instead of global
to the API server. This allows integration tests that use distinct
provider names to run in parallel when simulating key expiry.

Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>

Kubernetes-commit: 480fad996d58af5f6700389a68c662287e746992
2025-09-09 13:08:56 -07:00
Marek Siarkowicz aa97561e5f Use increaseRV in TestWatchStreamSeparation to imply external RV increase
Kubernetes-commit: 31e035ec39e27f14d01dbe3cd466416998ba1939
2025-09-10 14:08:38 +02:00
Marek Siarkowicz 89a0518f28 Cleanup enabling resource size estimate
Kubernetes-commit: edc8dafc6993dd7928cc148687a23d7eaaa23f99
2025-09-04 09:38:18 +02:00
Jordan Liggitt 4d892e4443 Revert "protect against race between deletion and adding finalizers"
This reverts commit 1dd33c8e6de2428bb0bb50142518158764fbb942.

Kubernetes-commit: 229954d1138c13346546715ef34abd29989f76ac
2025-09-09 16:33:42 -04:00
Nour 73481249c0 Replace deprecated strings.Title with cases.Title
Kubernetes-commit: 72847ee1f7571f1b8b51d4566302c62b31b1edf8
2025-08-30 18:16:59 +03:00
Jordan Liggitt 0829991ecb protect against race between deletion and adding finalizers
Kubernetes-commit: 1dd33c8e6de2428bb0bb50142518158764fbb942
2025-01-22 17:19:03 -05:00
Mayuka Channankaiah 34cfc51b85 Replace usage of deprecated ErrWaitTimeout with recommended method across all Pkgs
Kubernetes-commit: 6c56d2fd1bc54a7bcda84c8a83428877d9b39e96
2025-08-01 14:18:06 +05:30
aerosouund a793a9ad31 return an error in case nil selectors are passed to matcher functions
Signed-off-by: aerosouund <aerosound161@gmail.com>

Kubernetes-commit: f1d0c5dbc398ceeb9d62d7cb2ab11a3aed3fc14a
2025-08-29 16:12:31 +03:00
Marek Siarkowicz 3127846a6e Enforce that all resources set resourcePrefix
Kubernetes-commit: 683a76dd159bc329a840778b474059ed0b9d8c11
2025-09-03 10:23:29 +02:00
Marek Siarkowicz 80746a8efd Disable estimating resource size for resources with watch cache disabled
Listing all keys from etcd turned out to be too expensive, negativly
impacting events POST latency. Events resource is the only resource that
by default has watch cache disabled and which includes very
large number of small objects making it very costly to list keys.

Expected impact:
* No apiserver_resource_size_estimate_bytes metric for events.
* APF overestimating LIST request cost to events. Fallback assumes
  object size of 1.5MB, meaning LIST events will always get maxSeats

Kubernetes-commit: 3e84e16315ac2b3cb9729a98ed1ae636d8900db6
2025-09-03 15:42:41 +02:00
Marek Siarkowicz ba83a7fa01 Disable collecting stats for resources not setting prefix to prevent error logs
Kubernetes-commit: 588276255bab9900b976aad19f58a6c821bd39eb
2025-09-01 10:21:52 +02:00
Ben Luddy 36d7848a30 Configure JSON content type for generic webhook RESTClient.
Authorization, token authentication, imagepolicy admission, and audit webhooks configure RESTClients
that encode to JSON regardless of the ContentType of the provided rest.Config. Because this is
opaque to the RESTClient, configuring a ContentType other than "application/json" results in
requests with JSON-encoded bodies and a non-JSON media type in the Content-Type header. Webhook
servers that respect the Content-Type request header will be unable to decode an object from the
request body.

Explicitly overriding the ContentType of the provided rest.Config fixes this issue and is consistent
with how clients are constructed for conversion and admission webhooks.

Kubernetes-commit: ed07efbc57939afdf154afa80be35507d0a81d66
2025-07-15 11:28:06 -04:00
Alex Dudko cb5a78f9ba metrics: don't record apiserver_request_sli_duration_seconds for dryRun requests
Kubernetes-commit: dd37ad1bc2cd9df470924d4891f5b4bc7405ab66
2025-05-22 18:23:05 -05:00
Alex Dudko e2cbce8b03 metrics: add dry_run label to apiserver_request_sli_duration_seconds
Signed-off-by: Alex Dudko <alex.dudko@gmail.com>

Kubernetes-commit: 6f1abad18e5db7c4269f03fb4c41f35c9a1ab2cb
2025-03-27 15:19:49 -05:00
Richa Banker e8d163a6bc Register apiserver_resource_objects in TestDeleteStoreStats
Kubernetes-commit: 3995b6cf72bbd5ec8ed964d7fcbb9fcf440d1d36
2025-08-06 16:57:37 -07:00
David Bimmler ad4acd27c3 cache: do not allocate chan for nothing (#133500)
* cache: do not allocate chan for nothing

The explicit purpose of this channel is to never be closed and nothing
to be sent down on it. Hence, there's no need to allocate a channel - a
nil channel has exactly the desired behaviour.

Additionally, this is more relevant now that testing/synctest gets
unhappy when goroutines are blocked on reading on channels which are
created outside of the synctest bubble. Since this is a package var, that's
hard to avoid when using this package. Synctest is fine with nil
channels though.

Reported-by: Jussi Maki <jussi@isovalent.com>
Signed-off-by: David Bimmler <david.bimmler@isovalent.com>

* handlers: do not allocate chan for nothing

Nil chan has the desired semantics already, and this breaks
testing/synctest because the channel is allocated outside of the bubble.

Signed-off-by: David Bimmler <david.bimmler@isovalent.com>

---------

Signed-off-by: David Bimmler <david.bimmler@isovalent.com>

Kubernetes-commit: 52b7d035f9655d0c6ebeaaafd60add99700bb468
2025-08-28 04:14:34 +00:00
Richa Banker 45fdfc0ca4 Add sig-instrumentation as OWNERS for apiserver/pkg/storage/etcd3/metrics
Kubernetes-commit: a28eda435f2c2d5f4cd4461466fea87897d9822b
2025-08-08 09:58:02 -07:00
Owen Strain 7b84a2828a Bugfix: DeleteOptions decode errors should return 400 instead of 500
Kubernetes-commit: eac9da061ddf3b2d71ffcab124af8b0e3fb71cae
2025-08-01 00:21:54 +00:00
Gavin Lam fefd424016 feat: increment an internal metric when duplicate validation errors
Signed-off-by: Gavin Lam <gavin.oss@tutamail.com>

Kubernetes-commit: d0816f84f9c46de3fbeddfb022c2be7bd4157301
2025-07-31 00:48:29 -04:00
Marek Siarkowicz 7f5c70221d Fix storage counting all objects instead just objects for resource
Kubernetes-commit: d49e3d67cb39eb2dee6e9216ffed0e3ae13501a5
2025-08-19 15:09:44 +02:00
Richa Banker b64541f9b2 Remove DeprecatedVersion for apiserver_storage_objects, adjust help text
Kubernetes-commit: cbd6fb867ba26f977df605fe6a84f8570ed7abdc
2025-08-07 14:02:46 -07:00
Richa Banker 646afb740b Use Delete() instead of DeleteLabelValues() for etcd metrics
Kubernetes-commit: 2629fe25faa73837201dcfc7c4de039112ca125f
2025-08-06 21:24:27 -07:00
Antonio Ojea 8f1beab7b2 fix flake on TestStreamTranslator_WebSocketServerErrors
The metrics assertion race with the metric update, and since this
happens at the serverside, we use an active look to check the metrics
instead of expecting to be updated immidiatly.

Change-Id: I9a64b66301d5f4ac3df0c0a01de10602a20f89ea

Kubernetes-commit: f07dcd443d7335d09dc0de7a47485e2e6c87d725
2025-07-24 21:56:42 +00:00
Antonio Ojea 1c694e9979 websocket streamtranslator increament metrics before writing status
Test that assert on metrics use the returned status to sync the test, if
the metric is updated AFTER the state is returned the test will flake
because the assertion on the metric will race.

Change-Id: I317708a22cb47256c37dac3cab0463a2f925ad6b

Kubernetes-commit: 7ba22700bfd12cd32ff72db022e4b53ccda1deca
2025-07-28 21:59:08 +00:00
Antonio Ojea c8e4cae9a6 TestStreamTranslator_BlockRedirects use subtests
Reset metrics per status code also allow to  log the particular status
code that flake, in case the problem comes from an specific one.

Change-Id: I29f67d4c5d76449350f45049f45ce8325a2d0ddd

Kubernetes-commit: 0aea6a1e45d178371b44eabcaf0d318a01f9ac3d
2025-07-24 21:38:10 +00:00
Joel Speed 76004fdd79 Fix IntOrString cost estimation when schema has a MaxLength constraint
Kubernetes-commit: 8dc20a0f62d44af1d584efbbc6bf918b93c4e3d8
2025-07-09 12:14:28 +01:00
ylink-lfs f6d019a595 chore: ptrTo util removal with ptr.To
Kubernetes-commit: 5f4a1aa58c3dbdffbc5bd49a1bd7363b1cd20345
2025-07-24 09:11:09 +08:00
Simran Kaur dae80c21fd List available endpoints for kube-apiserver (#132581)
Fix tests and formatting

Use ListedPaths for finding useful endpoints

Fix maps import

Update dependencies

Fix lint

Add option to pass listedpaths

Remove apiserver component check

Install statuz in genericapiserver

Register zpagesfeatures

Fix import order

Avoid adding non-debugging endpoints

Fix tests

Fix tests

fix tests

Sort paths

Sort in-place

Copy paths before sorting

Fix string initialization

Move sorting to later stage

Fix imports

Kubernetes-commit: c7d6c09683344d6dacbe5ba3383a8217c1d4ccd7
2025-07-24 07:00:07 +00:00
Jordan Liggitt b2f2a14eb2 Add flake debugging for admission test
Kubernetes-commit: c7bf3b81f6a1a7c9ed2dc7b9f9ff5134926ecfc2
2025-07-23 09:42:27 -04:00
Dan Winship ac3b5ee521 Port aggregated apiserver discovery to EndpointSlices
Co-Authored-by: Jordan Liggitt <liggitt@google.com>

Kubernetes-commit: d70e7e223cf5a02d0bdf557a57da11a276ec1e8c
2025-01-26 08:55:01 -05:00
Dan Winship c7df1daeb0 Add utilities for getting EndpointSlices for a Service
Co-Authored-by: Jordan Liggitt <liggitt@google.com>

Kubernetes-commit: 41dc2d3b0240c925110152c28fb41339d57d14e7
2025-05-22 13:30:11 -04:00
Taahir Ahmed 9dbb4eabfc Pod Certificates: Basic implementation
* Define feature gate
* Define and serve PodCertificateRequest
* Implement Kubelet projected volume source
* kube-controller-manager GCs PodCertificateRequests
* Add agnhost subcommand that implements a toy signer for testing

Change-Id: Id7ed030d449806410a4fa28aab0f2ce4e01d3b10

Kubernetes-commit: 4624cb9bb92186358e001be392e50e5d23b5cdd9
2024-08-30 07:47:15 +00:00
David Ashpole 3c805a81ea graduate APIServerTracing featuregate to GA
Kubernetes-commit: 7236f3fc2c2c351f55b93a4ae9eb6ac5efcfb810
2025-06-16 20:25:37 +00:00
David Ashpole 7140865be4 promote TracingConfiguration to v1
Kubernetes-commit: 75fc2b1cf6d3b0276b0e8803bcd4af7cd4df4d3b
2025-06-16 20:20:42 +00:00