Commit Graph

5282 Commits

Author SHA1 Message Date
Jens-Uwe Walther
18a54f0a40 Add CertificateSigningRequest create log entry for default kubelet debug level V2
Kubernetes-commit: b7bd70192397c5d52c18a5f85e87cec66ccc9a9f
2026-02-09 21:12:39 +01:00
Kubernetes Publisher
6cda0df027 Merge pull request #136824 from cnuss/issues/136823
client-go: Replace deprecated BackoffManager with DelayFunc in Reflector

Kubernetes-commit: fb78de873af5e2611776f0c5093d994a9331f698
2026-02-13 04:27:35 +00:00
Kubernetes Publisher
fd1b7118fd Merge pull request #134675 from JoelSpeed/enable-kal-optionalorrequired-apiserver-internal
Enforce either optional or required tag on apiserverinternal API group

Kubernetes-commit: 9571e19da950a23312100fbb7c5d4fe76ce0413c
2026-02-13 04:27:34 +00:00
Kubernetes Publisher
ca54862893 Merge pull request #134827 from michaelasp/rvStore
Add Resource Version query and Bookmarks to thread safe store

Kubernetes-commit: 03da2455859aacb1e542e1e46a4c8b41750d55dc
2026-02-13 04:27:31 +00:00
Kubernetes Publisher
7aaede7872 Merge pull request #136921 from dims/dump-from-utils
Move dump package from apimachinery to k8s.io/utils

Kubernetes-commit: 5b63a8c68e8e4d417ab3758c7a80118c2db27ac9
2026-02-12 20:52:28 +00:00
Joel Speed
2c400a844a Restore omitempty on ServerStorageVersion fields
Kubernetes-commit: 82a9a99a44ce2c41fc07dfcd8651d89652659976
2026-02-12 17:59:07 +00:00
Kubernetes Publisher
9f57ca57bd Merge pull request #136729 from ahmedtd/podcert-pkcs10
Pod Certificates: Add StubPKCS10Request; migrate in-tree usages

Kubernetes-commit: 54489c1a338ba521f36f5b73667f03a8e164d18e
2026-02-12 00:52:04 +00:00
Kubernetes Publisher
0efa7daafd Merge pull request #136925 from michaelasp/pipeFeatureGate
Pipe feature gate of unlockWhileProcessing

Kubernetes-commit: 7b999810bf37c025ba146e3e1feae80b44eac6d6
2026-02-11 08:51:42 +00:00
Kubernetes Publisher
82ed9ba53e Merge pull request #135395 from pohly/apimachinery-wait-for-cache-sync
apimachinery + client-go + device taint eviction unit test: context-aware Start/WaitFor, waiting through channels

Kubernetes-commit: eb09a3c23e3c3905c89e996fcec2c02ba8c4bb0e
2026-02-11 08:51:41 +00:00
Kubernetes Publisher
07f99e4437 Merge pull request #135256 from natasha41575/pod-gen-field
remove Pod Generation feature gate from field descriptions

Kubernetes-commit: 99d4b4d426b751cc7ca3f7b3e118c899af8fbfde
2026-02-11 00:51:49 +00:00
Michael Aspinwall
b8c6b3c159 Pipe feature gates
Kubernetes-commit: 718ebb6dfc7a5a64ee17821a0de177e3a1eb11f0
2026-02-10 22:39:18 +00:00
Davanum Srinivas
decb8c0791 Move dump package from apimachinery to k8s.io/utils
Replace all imports of k8s.io/apimachinery/pkg/util/dump with
k8s.io/utils/dump across the repo. The apimachinery dump package
now contains deprecated wrapper functions that delegate to
k8s.io/utils/dump for backwards compatibility.

Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: 550cc8645bedcc8b187e0ebeb52ead29d5631a32
2026-02-10 15:20:41 -05:00
Christian Nuss
b5668cea26 client-go: Replace deprecated BackoffManager with DelayFunc in Reflector
Move backoff documentation comments to var block for better discoverability.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>

Kubernetes-commit: 33ebd41b2c1abdc03beabd9ccff3428a8fd46473
2026-02-07 12:04:08 -05:00
Taahir Ahmed
3721aecc15 Pod Certificates: make update
Kubernetes-commit: c76efb3a145830f40ee042b8823e83a973e24372
2026-02-03 20:26:42 -08:00
Michael Aspinwall
139a95c065 Plumb bookmark RVs to controller for observation
Kubernetes-commit: 428b903cd990762a2588fa471791d9c8c747c196
2026-01-28 22:30:06 +00:00
Michael Aspinwall
d883e606da Add rv query to store
Kubernetes-commit: 9c6ac550efa6e721c85b0f1074f26f734286fba9
2026-01-28 22:29:39 +00:00
Patrick Ohly
ff8083eb1d client-go informers: context-aware Start + WaitForCacheSync
Passing a context to StartWithContext enables context-aware reflector
logging. This is the main remaining source of log spam (output to stderr
instead of per-test logger) in controller unit tests.

WaitForCacheSynceWithContext takes advantage of the new cache.WaitFor +
NamedHasSynced functionality to finish "immediately" (= no virtual time
passed) in a synctest bubble. While at it, the return type gets improved so
that a failure is easier to handle.

Kubernetes-commit: 5ff323de791df88880f6e065f5de4b445e5c90ed
2025-11-21 16:23:44 +01:00
Patrick Ohly
e70bc766e0 client-go cache: wait for cache sync via channels, better logging
The main advantage is that waiting on channels creates a causal relationship
between goroutines which is visible to synctest. When a controller in a
synctest bubble does a WaitFor in a test's background goroutine for the
controller, the test can use synctest.Wait to wait for completion of cache
sync, without requiring any test specific "has controller synced" API. Without
this, the test had to poll or otherwise wait for the controller.

The polling in WaitForCacheSync moved the virtual clock forward by a random
amount, depending on how often it had to check in wait.Poll. Now tests can be
written such that all events during a test happen at a predictable time. This
will be demonstrated in a separate commit for the
pkg/controller/devicetainteviction unit test.

The benefit for normal production is immediate continuation when the last
informer is synced (not really a problem, but still...) and more important,
nicer logging thanks to the names associated with the thing that is being
waited for. The caller decides whether logging is enabled or disabled and
describes what is being waited for (typically informer caches, but maybe also
event handlers or even something else entirely as long as it implements the
DoneChecker interface).

Before:

    Waiting for caches to sync
    Caches are synced

After:

    Waiting for="cache and event handler sync"
    Done waiting for="cache and event handler sync" instance="SharedIndexInformer *v1.Pod"
    Done waiting for="cache and event handler sync" instance="SharedIndexInformer *v1.ResourceClaim"
    Done waiting for="cache and event handler sync" instance="SharedIndexInformer *v1.ResourceSlice"
    Done waiting for="cache and event handler sync" instance="SharedIndexInformer *v1.DeviceClass"
    Done waiting for="cache and event handler sync" instance="SharedIndexInformer *v1alpha3.DeviceTaintRule"
    Done waiting for="cache and event handler sync" instance="SharedIndexInformer *v1.ResourceClaim + event handler k8s.io/kubernetes/pkg/controller/devicetainteviction.(*Controller).Run"
    Done waiting for="cache and event handler sync" instance="SharedIndexInformer *v1.Pod + event handler k8s.io/kubernetes/pkg/controller/devicetainteviction.(*Controller).Run"
    Done waiting for="cache and event handler sync" instance="SharedIndexInformer *v1alpha3.DeviceTaintRule + event handler k8s.io/kubernetes/pkg/controller/devicetainteviction.(*Controller).Run"
    Done waiting for="cache and event handler sync" instance="SharedIndexInformer *v1.ResourceSlice + event handler k8s.io/kubernetes/pkg/controller/devicetainteviction.(*Controller).Run"

The "SharedIndexInformer *v1.Pod" is also how this appears in metrics.

Kubernetes-commit: fdcbb6cba9a04c028b158bf66d505df7431f63fe
2025-11-18 12:39:11 +01:00
Patrick Ohly
b37e79caad client-go cache: allow passing name+logger to DeltaFIFO, RealFIFO and Reflector
This improves logging and enables more informative waiting for cache sync in a
following commit. It addresses one klog.TODO in the Reflector.

The RealFIFOOptions and InformerOptions structs get extended the same way as
DeltaFIFOOptions before: a logger may be set, but it's not required. This is
not an API break.

That the name has to be passed separately is a bit annoying at first glance
because it could also be set directly on the logger through WithName, but
keeping it separate is better:
- name can be set without providing a logger
- name can be defaulted
- less code in the caller when passing through a logger and adding
  the name only in the field
- last but not least, extracting the name is not supported in a portable
  manner by logr

All in-tree references in production code get updated.

While at it, logging in the fifos gets updated to follow best practices: if
some code encounters an abnormal situation and then continues, it should use
utilruntime.HandleErrorWithLogger instead of normal error logging.

Existing "logger" fields get moved to the top because that is a more common
place for such a read-only field.

Kubernetes-commit: 45251e5f654e6c052659d110cd721f9fbe185191
2025-11-18 18:09:46 +01:00
Natasha Sarkar
1ee3eb7041 remove Pod Generation feature gate from field descriptions
Kubernetes-commit: d5dabfcd658def79f6b1e1c3c680d5c1711e24f7
2025-11-11 16:44:33 +00:00
Kubernetes Publisher
8fcd3c218f Merge pull request #136826 from alvaroaleman/bumpv0.32
Bump structured merge diff to v6.3.2

Kubernetes-commit: 65f09e605cb206b2e5fcff4d69a4ae8acf62dbc3
2026-02-10 20:21:19 +00:00
Kubernetes Publisher
c6e2e47b31 Merge pull request #136455 from pohly/client-go-simpleclient-undeprecation
fake client-go: un-deprecate NewSimpleClientset

Kubernetes-commit: 09e1c9fe0ec3d3a61fa71c43610b42e1e3f53612
2026-02-10 00:00:21 +00:00
Alvaro Aleman
c02524f944 Bump structured merge diff to v6.3.2
Diff: https://github.com/kubernetes-sigs/structured-merge-diff/compare/v6.3.1...v6.3.2

It's just one change that prevents a NPD when an embedded pointer to a
struct is encountered.

Kubernetes-commit: f59cfe60ef2063e2383ebef416f9da05196903d6
2026-02-07 13:49:48 -05:00
Patrick Ohly
aac099e7c2 fake client-go: un-deprecate NewSimpleClientset
NewSimpleClientset was marked as deprecated when NewClientset was
introduced. This has caused some confusion:
- Not all packages have NewClientset (https://github.com/kubernetes/kubernetes/issues/135980).
- Tests that work with NewSimpleClientset fail when
  switched to NewClientset (https://github.com/kubernetes/kubernetes/issues/136327)
  because of missing CRD support (https://github.com/kubernetes/kubernetes/issues/126850).

It doesn't seem burdensome to keep NewSimpleClientset around forever. Some unit
tests may even prefer to use it when they don't need server-side apply (less
overhead). Therefore there is no need to deprecate it.

This avoids churn in the eco system because contributors no longer create PRs
"because the linter complains about the usage of a deprecated function".

Kubernetes-commit: e80da21868059f789c90105a00481fa8cef169e1
2026-01-23 11:20:40 +01:00
Kubernetes Publisher
67ce519612 Merge pull request #135782 from richabanker/fifo-identity-metric
Add identifier-based queue depth metrics for RealFIFO

Kubernetes-commit: 8972957668a174bbb589f167817130e0f2d352a9
2026-02-06 03:52:42 +00:00
Richa Banker
12b64ed22e Wire InformerName through SharedIndexInformer
Kubernetes-commit: 96386809339faee1169d163749cb4b7d354bec1e
2026-02-05 11:45:38 -08:00
Richa Banker
5fee0e4466 Generate informers with InformerName support
Kubernetes-commit: 1fec293a1d9fc53e0e3f1a6a3fe6f8970110c1a7
2026-02-05 11:42:54 -08:00
Richa Banker
117e93e87c Add FIFO queue depth metrics
Kubernetes-commit: 864357774f24ee17b2bc7bde84eb5b87cc7ab95b
2026-02-05 11:42:20 -08:00
Kubernetes Publisher
c148db9511 Merge pull request #136747 from dims/use-k8s-utils-btree
Use btree from k8s.io/utils instead of github.com/google/btree

Kubernetes-commit: dc1ec1211e4f54064ba6dafd8aac46ac3d4379b4
2026-02-05 11:42:33 +00:00
Kubernetes Publisher
aa31c74d1f Merge pull request #136694 from michaelasp/addEmulationToClientGo
Add the ability to update locked features in client-go testing

Kubernetes-commit: 365fd08d5898a099cdc40eaf2a53d5a40125b1f0
2026-02-05 02:04:32 +05:30
Davanum Srinivas
4ba33933bd Use btree from k8s.io/utils instead of github.com/google/btree
The google/btree package is deprecated, so switch to the maintained
fork in k8s.io/utils/third_party/forked/golang/btree.

API differences:
- NewG -> New
- BTreeG[T] -> BTree[T]

Signed-off-by: Davanum Srinivas <davanum@gmail.com>

Kubernetes-commit: a328ca88ad662119bbf129cd1107fabd8dd9f539
2026-02-04 09:19:58 -05:00
Michael Aspinwall
88493c6cb6 Lock InOrderInformers to true by default
Kubernetes-commit: 566a01682fe526812b5f12453908864827300b6f
2026-02-03 21:54:29 +00:00
Michael Aspinwall
c752307a85 Add SetForTesting for testing feature gates
Kubernetes-commit: 8099c570428806404b1a400143156c2ed0c67658
2026-02-03 21:49:09 +00:00
Kubernetes Publisher
65608ffa8e Merge pull request #136601 from michaelasp/realFifoGA
Set RealFIFO to GA in 1.36

Kubernetes-commit: 1861c1a07244e8e9430aaf588722dd22287c471e
2026-02-04 03:42:25 +00:00
Kubernetes Publisher
f651faf894 Merge pull request #136509 from pohly/client-go-informer-deadlock
client-go informers: fix potential deadlock

Kubernetes-commit: cc0fdc1fe2cfada52875a0c5fa115f69b4dd477a
2026-01-29 21:44:57 +00:00
Kubernetes Publisher
ada74e06af Merge pull request #136424 from JoelSpeed/podgroup-union
Mark PodGroupPolicy up with openapi union member tags

Kubernetes-commit: 8f4c197169bd4454bef3f7fc47ce02a324d51c76
2026-01-29 21:44:56 +00:00
Richa Banker
50ef81ad18 Add identity tracking for queue items
Kubernetes-commit: db27f4c1234a50e3157373c060ac8ba71c513500
2026-01-28 19:01:51 -08:00
Kubernetes Publisher
f3637bd93c Merge pull request #136583 from michaelasp/watchListRVEnforcement
Ensure resource version callbacks aren't called preemptively in reflector

Kubernetes-commit: ebc5660fa5c37e5e2f4bc85aff7f181d03955a9c
2026-01-29 01:49:03 +00:00
Michael Aspinwall
072a1958db Set RealFIFO to GA in 1.36
Kubernetes-commit: 7107e2f3500091155ac54a2d16a0eb0a9b557d1c
2026-01-28 22:37:37 +00:00
Kubernetes Publisher
2d68c1db51 Merge pull request #135106 from bkhadars/enable-commentstart1
enable commentstart check on admissionregistration API group

Kubernetes-commit: a41a5c35d38479df7bfa462ec24221a5198a0e5f
2026-01-28 17:44:36 +00:00
Kubernetes Publisher
a48da785a9 Merge pull request #129332 from pohly/log-client-go-clientcmd
client-go command: structured, contextual logging

Kubernetes-commit: 1c9da264ab83ac34efd0422711e1a222ffcb1b03
2026-01-28 13:44:55 +00:00
Kubernetes Publisher
67189d0e25 Merge pull request #136582 from yongruilin/master_kubeopenapi-format
Bump k8s.io/kube-openapi to latest and enable numeric format validation

Kubernetes-commit: b90909e4325d5375af7deb190585a5e9885c288d
2026-01-28 01:44:00 +00:00
Michael Aspinwall
ef73fc0205 Add enforcement for rv update in watchlist to preserve the rv ordering invariant
Kubernetes-commit: 35d29e4772261b283498e04148b89cef64fd6297
2026-01-27 23:09:17 +00:00
yongruilin
2d1d3a8458 Bump k8s.io/kube-openapi to latest
Kubernetes-commit: 65b579a036fa3b230f9c5e22d449fe9e4790078e
2026-01-27 21:39:39 +00:00
Kubernetes Publisher
146146cf95 Merge pull request #136574 from pohly/revert-129344-log-client-go-apimachinery-network-util
Revert "apimachinery: contextual logging in network util code"

Kubernetes-commit: 99a2c5c6346ad84976f9bda40034670a97950f24
2026-01-27 17:44:25 +00:00
Patrick Ohly
b0c7207279 Revert "apimachinery: contextual logging in network util code"
Kubernetes-commit: 9d65b9be20e5ee0a4ef34f0ba071d35987da4ab0
2026-01-27 17:21:02 +01:00
Kubernetes Publisher
5b20bd05fc Merge pull request #136441 from kannon92/remove-alpha-api-dra
remove alpha comments for GA or beta resource fields

Kubernetes-commit: be658b44f32ee69146505094ac3a03418832f9b6
2026-01-27 17:44:24 +00:00
Patrick Ohly
3590eb7f48 client-go informers: replace time.Sleep with callback
While time.Sleep is what the test needs, maybe an arbitrary hook invocation is
more acceptable in the production code because it is more general.

Kubernetes-commit: 2ec0305d728bf5ce8f8df314a18e71aa120a00cf
2026-01-27 14:47:37 +01:00
Patrick Ohly
889b95a769 client-go informers: fix potential deadlock
In the unlikely situation that sharedProcessor.distribute was triggered by a
resync before sharedProcessor.run had a chance to start the listeners, the
sharedProcessor deadlocked: sharedProcessor.distribute held a read/write lock
on listenersLock while being blocked on the write to the listener's
channel. The listeners who would have read from those weren't get started
because sharedProcessor.run was blocked trying to get a read lock for
listenersLock.

This gets fixed by releasing the read/write lock in sharedProcessor.distribute
while waiting for all listeners to be started. Because either all or no
listeners are started, the existing global listenersStarted boolean is
sufficient.

The TestListenerResyncPeriods tests now runs twice, with and without the
artificial delay. It gets converted to a synctest, so it executes quickly
despite the time.Sleep calls and timing is deterministic. The enhanced log
output confirms that with the delay, the initial sync completes later:

    === RUN   TestListenerResyncPeriods
        shared_informer_test.go:236: 0s: listener3: handle: pod1
        shared_informer_test.go:236: 0s: listener3: handle: pod2
        shared_informer_test.go:236: 0s: listener1: handle: pod1
        shared_informer_test.go:236: 0s: listener1: handle: pod2
        shared_informer_test.go:236: 0s: listener2: handle: pod1
        shared_informer_test.go:236: 0s: listener2: handle: pod2
        shared_informer_test.go:236: 2s: listener2: handle: pod1
        shared_informer_test.go:236: 2s: listener2: handle: pod2
        shared_informer_test.go:236: 3s: listener3: handle: pod1
        shared_informer_test.go:236: 3s: listener3: handle: pod2
    --- PASS: TestListenerResyncPeriods (0.00s)
    === RUN   TestListenerResyncPeriodsDelayed
        shared_informer_test.go:236: 1s: listener1: handle: pod1
        shared_informer_test.go:236: 1s: listener1: handle: pod2
        shared_informer_test.go:236: 1s: listener2: handle: pod1
        shared_informer_test.go:236: 1s: listener2: handle: pod2
        shared_informer_test.go:236: 1s: listener3: handle: pod1
        shared_informer_test.go:236: 1s: listener3: handle: pod2
        shared_informer_test.go:236: 2s: listener2: handle: pod1
        shared_informer_test.go:236: 2s: listener2: handle: pod2
        shared_informer_test.go:236: 3s: listener3: handle: pod1
        shared_informer_test.go:236: 3s: listener3: handle: pod2
    --- PASS: TestListenerResyncPeriodsDelayed (0.00s)

Kubernetes-commit: e6ef79b2f6bb05205652e4fe48ffa523d9e3a1ec
2026-01-23 19:38:52 +01:00
Kevin Hannon
0c949f1da7 remove alpha comments for GA or beta DRA fields
Kubernetes-commit: 159eb4cd7719a1c5de2c332e811a2b598ee1a4d2
2026-01-22 17:03:40 -05:00