Commit Graph

134582 Commits

Author SHA1 Message Date
Kubernetes Prow Robot
18663b347e Merge pull request #135983 from Goend/master
Fix the issue of slow creation of ResourceClaim in specific scenarios
2026-01-07 20:05:46 +05:30
Kubernetes Prow Robot
4e69edd0ee Merge pull request #135392 from brejman/issue-134393-nominated-nodes
Fix queue hint for plugins on change to pods with nominated nodes
2026-01-07 20:05:38 +05:30
Kubernetes Prow Robot
fe36b79c2a Merge pull request #135959 from pohly/client-go-testing-list-and-watch-race
client-go testing: support List+Watch with ResourceVersion
2026-01-07 19:01:45 +05:30
Kubernetes Prow Robot
08ad958d0d Merge pull request #135774 from pohly/e2e-framework-ginkgo-wrappers
E2E framework: make usage of Ginkgo wrappers optional
2026-01-07 19:01:38 +05:30
Kubernetes Prow Robot
21f7c3ff68 Merge pull request #135777 from serathius/init-hook-default
Enable WatchCacheInitializationPostStartHook by default
2026-01-07 17:31:46 +05:30
Kubernetes Prow Robot
ed17ca808f Merge pull request #132145 from inkel/inkel/client-go/improve-bearerauthrt-roundtrip-perf
fix(client): Concatenate string instead of using `fmt.Sprintf`
2026-01-07 17:31:38 +05:30
Patrick Ohly
e4ab523161 E2E framework: make usage of Ginkgo wrappers optional
Previously it was necessary to use the Ginkgo wrappers when
using any of the custom arguments like WithSlow(). Now the
hook within Ginkgo for modifying arguments is used such that
e.g. the original ginkgo.It also works.
2026-01-07 12:05:43 +01:00
Patrick Ohly
47d02070ba E2E: remove unnecessary trailing spaces in test names
The spaces are unnecessary because Ginkgo adds spaces automatically.

This was detected before only for tests using the wrapper functions,
now it also gets detected for ginkgo methods.
2026-01-07 12:05:43 +01:00
Kubernetes Prow Robot
37f7634ee3 Merge pull request #135961 from serathius/watchcache-testing-dummy
Move dummy testing to subpackage
2026-01-07 16:29:39 +05:30
Marek Siarkowicz
f42b1db39a Move dummy testing to subpackage
Change-Id: I52863cf256fc52b863c182932eb9520f3626adc3
2026-01-07 11:10:42 +01:00
Kubernetes Prow Robot
6af6361e3b Merge pull request #134798 from aditigupta96/fix-runwithcontext-apimachinery
apimachinery: Use informer.RunWithContext in various components
2026-01-07 05:45:37 +05:30
Kubernetes Prow Robot
2df19bd236 Merge pull request #136058 from yongruilin/vg-master_skip-list
feat(validation-gen): skip generating for List objects
2026-01-07 02:59:38 +05:30
yongruilin
016e821718 run codegen 2026-01-06 20:18:06 +00:00
yongruilin
2a4951be27 feat: skip validation for types that are Lists in GetTargets function 2026-01-06 20:17:02 +00:00
Kubernetes Prow Robot
ca3d030261 Merge pull request #134177 from n2h9/126379-replace-HandleCrash-with-HandleCrashWithContext-in-apiserver-00
[apiserver] [126379]: replace call to HandleCrash with call to HandleCrashWithContext in apiserver
2026-01-07 01:13:37 +05:30
Matteo Fari
a1d638ea11 Enable nomaps rule for Kube API Linter (#134852)
* tested how many errors

* added exceptions

* added scoped exceptions per API group

* added struct.field specification

* improved regex match and included core and resources with the new struct.field format

* condensed exceptions using regex as requested

* fixed the scope kal nomaps exceptions to match existing fields
2026-01-06 23:59:39 +05:30
Kubernetes Prow Robot
4c5746c0bc Merge pull request #134680 from JoelSpeed/enable-kal-integers
Enable integers rule for Kube API Linter
2026-01-06 22:39:39 +05:30
Kubernetes Prow Robot
3edae6c1c4 Merge pull request #136053 from tchap/kcm-leader-election-thread-mgmt
leasecandidate: Improve goroutine management
2026-01-06 20:59:08 +05:30
Goend
13e46ffc45 Fix the issue of slow creation of ResourceClaim in specific scenarios 2026-01-06 19:18:58 +08:00
Ondra Kupka
498896ec42 leasecandidate: Improve goroutine management
Make sure all goroutines are terminated when Run returns.
2026-01-06 10:43:05 +01:00
Kubernetes Prow Robot
76c562be4a Merge pull request #135611 from Karthik-K-N/fix-device-taint
Fix flake TestDeviceTaintRule test
2026-01-06 14:45:08 +05:30
Kubernetes Prow Robot
f36be36c76 Merge pull request #136037 from pravk03/ndf-fix
Prevent nil pointer dereference in HandlePodUpdates
2026-01-06 11:16:38 +05:30
Karthik Bhat
cd7d35fa3d Fix flake TestDeviceTaintRule test by adjusting event hanlder status update logic
Co-authored-by: Pohly <patrick.ohly@intel.com>
2026-01-06 11:00:06 +05:30
Kubernetes Prow Robot
0f89b13c79 Merge pull request #135227 from hime/master
Inverting DRAOperationsDuration metric by inverting 'is_error' label.
2026-01-06 05:24:38 +05:30
Praveen Krishna
1ff74821f9 Fix: Prevent nil pointer dereference in HandlePodUpdates
In HandlePodUpdates, oldPod is nil for a mirror pod. Adding a nil check to prevent panic when the NodeDeclaredFeatures feature gate is enabled.
2026-01-05 20:41:45 +00:00
Patrick Ohly
5644850607 client-go testing: support List+Watch with ResourceVersion
Quite a lot of unit tests set up informers with a fake client, do
informerFactory.WaitForCacheSync, then create or modify objects. Such tests
suffered from a race: because the fake client only delivered objects to the
watch after the watch has been created, creating an object too early caused
that object to not get delivered to the informer.

Usually the timing worked out okay because WaitForCacheSync typically slept a
bit while polling, giving the Watch call time to complete, but this race has
also gone wrong occasionally. Now with WaitForCacheSync returning more promptly
without polling (work in progress), the race goes wrong more often.

Instead of working around this in unit tests it's better to improve the fake
client such that List+Watch works reliably, regardless of the timing. The fake
client has traditionally not touched ResourceVersion in stored objects and
doing so now might break unit tests, so the added support for ResourceVersion
is intentionally limited to List+Watch.

The test simulates "real" usage of informers. It runs in a synctest bubble and
completes quickly:

    go  test -v .
    === RUN   TestListAndWatch
        listandwatch_test.go:67: I0101 01:00:00.000000] Listed configMaps="&ConfigMapList{ListMeta:{ 1  <nil>},Items:[]ConfigMap{ConfigMap{ObjectMeta:{cm1  default    0 0001-01-01 00:00:00 +0000 UTC <nil> <nil> map[] map[] [] [] []},Data:map[string]string{},BinaryData:map[string][]byte{},Immutable:nil,},},}" err=null
        listandwatch_test.go:79: I0101 01:00:00.000000] Delaying Watch...
        listandwatch_test.go:90: I0101 01:00:00.100000] Caches synced
        listandwatch_test.go:107: I0101 01:00:00.100000] Created second ConfigMap
        listandwatch_test.go:81: I0101 01:00:00.100000] Continuing Watch...
    --- PASS: TestListAndWatch (0.00s)
    PASS
    ok  	k8s.io/client-go/testing/internal	0.009s

Some users of the fake client need to be updated to avoid test failures:
- ListMeta comparisons have to be updated.
- Optional: pass ListOptions into tracker.Watch. It's optional because
  the implementation behaves as before when options are missing,
  but the List+Watch race fix only works when options are passed.
2026-01-05 12:30:01 +01:00
Kubernetes Prow Robot
b2ac9e206f Merge pull request #130231 from Barakmor1/updateimagelocality
Update ImageLocality plugin to account ImageVolume images
2026-01-05 12:28:37 +05:30
Kubernetes Prow Robot
caf5cdc58b Merge pull request #135148 from neolit123/1.35-add-deprecated-api-flag-to-config-validate
kubeadm: add --allow-deprecated-api to 'config validate'
2026-01-04 18:30:37 +05:30
Kubernetes Prow Robot
bf0e7b694f Merge pull request #135856 from natasha41575/static_pod_check
[InPlacePodVerticalScaling] remove ineffectual static pod feasibility check
2025-12-31 07:18:34 +05:30
Kubernetes Prow Robot
d1c1efea52 Merge pull request #135976 from pohly/dra-scheduler-plugin-after-claim-change-fix
DRA scheduler: fix unit test flakes
2025-12-31 01:02:34 +05:30
Natasha Sarkar
9c7a83d30f remove ineffectual static pod check for resize 2025-12-30 17:35:32 +00:00
Kubernetes Prow Robot
a1f6c4171f Merge pull request #135971 from DEVMANISHOFFL/fix-kubeadm-reset-crash
fix(kubeadm): prevent nil pointer panic in reset command
2025-12-30 21:56:35 +05:30
Patrick Ohly
dfa6aa22b2 DRA scheduler: fix unit test flakes
Test_isSchedulableAfterClaimChange was sensitive to system load because of the
arbitrary delay when waiting for the assume cache to catch up. Running inside
a synctest bubble avoids this. While at it, the unit tests get converted
to ktesting (nicer failure output, no extra indention needed for
tCtx.SyncTest).

TestPlugin/prebind-fail-with-binding-timeout relied on setting up a claim with
certain time stamps and then getting that test case tested within a certain
real-world time window. It's surprising that this didn't flake more often
because test execution order is random. Now the time stamp gets set right
before the test case is about to be tested. Conversion to a synctest would
be nicer, but synctests cannot have sub-tests, which are used here to track
where log output and failures come from within the larger test case.

Inside the plugin itself some log output gets added to explain why a claim is
unavailable on a node in case of a binding timeout or error during Filter.
2025-12-30 11:45:02 +01:00
Kubernetes Prow Robot
3226fe520d Merge pull request #135948 from pohly/dra-scheduler-resource-plugin-unit-test-fix
DRA extended resources: fix flake in unit tests
2025-12-30 16:12:35 +05:30
devmanishofficial
ecf7e6d41f fix(kubeadm): prevent nil pointer panic in reset command
Signed-off-by: devmanishofficial <devmanishofficial@gmail.com>
2025-12-30 15:53:10 +05:30
Kubernetes Prow Robot
f1dbece0a4 Merge pull request #135974 from ErikJiang/fix/init-plan-slice-init
Optimize slice initialization in kubeadm
2025-12-30 15:12:34 +05:30
bo.jiang
e0d4e7075b Optimize slice initialization in kubeadm
Signed-off-by: bo.jiang <bo.jiang@daocloud.io>
2025-12-30 16:42:36 +08:00
Kubernetes Prow Robot
2a3a6605ac Merge pull request #135330 from sujalshah-bit/fix-mem-leak
scheduler: Fix memory leak in scheduler cache
2025-12-29 15:56:34 +05:30
Kubernetes Prow Robot
8d1296caf2 Merge pull request #135912 from pohly/scheduler-plugin-test-data-race
scheduler: plugin test DATA RACE fix
2025-12-29 14:46:35 +05:30
Kubernetes Prow Robot
dd838ccf07 Merge pull request #135954 from pohly/hack-test-features-script-removal
hack: remove list-feature-tests.sh
2025-12-28 23:54:33 +05:30
Kubernetes Prow Robot
ed4b5ee317 Merge pull request #134350 from macsko/add_scheduling_duration_collector
Add scheduling duration collector to scheduler_perf
2025-12-28 05:50:33 +05:30
Patrick Ohly
57b65a2509 hack: remove list-feature-tests.sh
The script is broken because it relies on grepping the source code.
This has always been fragile (currently it finds the search term
in comments) and stopped working years ago when changing how tests
are labeled.

Instead of fixing the script let's remove it because it's clearly unused.
2025-12-27 11:15:24 +01:00
Patrick Ohly
7a4d650125 DRA extended resources: fix flake in unit tests
The tests assumed that instantiating a DRAManager followed by
informerFactory.WaitForCacheSync would be enough to have the manager
up-to-date, but that's not correct: the test only waits for informer *caches*
to be synced, but syncing *event handlers* like the one in the manager may
still be going on. The flake rate is low, though:

    $ GOPATH/bin/stress -p 256 ./noderesources.test
    5s: 0 runs so far, 0 failures, 256 active
    10s: 256 runs so far, 0 failures, 256 active
    15s: 256 runs so far, 0 failures, 256 active
    20s: 512 runs so far, 0 failures, 256 active
    25s: 567 runs so far, 0 failures, 256 active
    30s: 771 runs so far, 0 failures, 256 active

    /tmp/go-stress-20251226T181044-974980161
    --- FAIL: TestCalculateResourceAllocatableRequest (0.81s)
        --- FAIL: TestCalculateResourceAllocatableRequest/DRA-backed-resource-with-shared-device-allocation (0.00s)
            extendedresourcecache.go:197: I1226 18:11:14.431337] Updated extended resource cache for explicit mapping extendedResource="extended.resource.dra.io/something" deviceClass="device-class-name"
            extendedresourcecache.go:204: I1226 18:11:14.431380] Updated extended resource cache for default mapping extendedResource="deviceclass.resource.kubernetes.io/device-class-name" deviceClass="device-class-name"
            extendedresourcecache.go:220: I1226 18:11:14.431394] Updated device class mapping deviceClass="device-class-name" extendedResource="extended.resource.dra.io/something"
            resource_allocation_test.go:595: Expected requested=2, but got requested=1
    FAIL

It becomes higher when changing WaitForCacheSync such that it doesn't poll and
therefore returns more promptly, which is where this flake was first observed.

The fix is to run the test in a syntest bubble where Wait can be used to wait
for all background activity, including event handling, to be finished before
proceeding with the test.

synctest is less forgiving about lingering goroutines. A synctest bubble must
wait for gouroutines to stop, which in this case means that there has to be
a way to wait for the metric recorder shutdown. Event handlers have to be
removed.

This could be done with plain Go, but here test/utils/ktesting is used instead
because it offers some advantages:
- less boilerplate code
- automatic cancellation of the context (i.e. less manual context.WithCancel)
- tCtx.SyncTest is a direct substitute for t.Run, which avoids re-indenting
  sub-tests. synctest itself needs another anonymous function, which makes
  the line too long and forced re-indention:
     t.Run(... func(...) {
         synctest.Test(... func() {
         })
     })

For the sake of consistency all tests get updated.

While at it, some code gets improved:

- t.Fatal(err) is not a good way to report an error because
  there is no additional markup in the test output that indicates
  that there was an unexpected error. It just logs err.Error(),
  which might not be very informative and/or obvious.
- newTestDRAManager aborts in case of a failure instead of
  returning an error.
2025-12-27 09:47:56 +01:00
Kubernetes Prow Robot
3c2e339be8 Merge pull request #135946 from borg-land/bump-gcp-ccm
bump gcp ccm to v35
2025-12-27 04:18:32 +05:30
Kubernetes Prow Robot
5023ec504c Merge pull request #135933 from pohly/dra-scheduler-unit-test-flakes
DRA ExtendedResourceCache: avoid risk of flakes
2025-12-27 01:48:32 +05:30
Kubernetes Prow Robot
8db962ba5a Merge pull request #135947 from michaelasp/UpdateKubeBinary
Update DefaultKubeBinaryVersion to 1.36
2025-12-27 00:18:32 +05:30
Michael Aspinwall
c2805d38c4 Update DefaultKubeBinaryVersion to 1.36 2025-12-26 17:06:32 +00:00
Kubernetes Prow Robot
d719bc771f Merge pull request #135938 from pohly/hack-verify-featuregates-output
hack/verify-featuregates.sh: print failure information to stderr
2025-12-26 19:56:32 +05:30
upodroid
2514b1df49 bump gcp ccm to v35 2025-12-26 13:39:58 +03:00
Patrick Ohly
ad012f63f7 hack/verify-featuregates.sh: print failure information to stderr
Verify scripts are run such that stderr is captured and included in the JUnit
files. Stdout is not. Therefore the instructions in case of a failure where
only visible by searching the entire job log file, but not in the Prow summary.
2025-12-26 10:37:10 +01:00