Commit Graph

134908 Commits

Author SHA1 Message Date
vshkrabkov
779ff43005 Add unschedulabe pods metric drop for pod deletion 2026-01-07 15:17:27 +00:00
Jordan Liggitt
5bba728bb8 Fix context timeout test flake 2026-01-07 09:47:47 -05:00
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
Antonio Ojea
d5ac0e408a leaderelection RWlock
We need to lock on observedTime reads to avoid races, before we were
only locking to read the observed record.

Use a RW lock since there are much more reads that writes.
2026-01-07 14:19:32 +00:00
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
Davanum Srinivas
bebefd8382 chore: update sig-architecture mailing list email
Update the mailing list for SIG Architecture to the new kubernetes.io Google Group:
- New: https://groups.google.com/a/kubernetes.io/g/sig-architecture/
- Old archive still available: https://groups.google.com/g/kubernetes-sig-architecture/

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2026-01-07 09:19:09 -04:00
Patrick Ohly
4e6cf3ca0c ktesting: shorter error logging in WithError
Gomega formats errors by first showing Error() (already has all information
after WithError) and then again by dumping the error struct, which is redundant
in this case. We can avoid the latter by providing a GomegaString
implementation which returns nothing.
2026-01-07 14:11:33 +01:00
Patrick Ohly
01765f4a41 ktesting: more flexible Eventually/Consistently
Being able to call arbitrary functions is useful, even if it means giving up
some compile-time checking. Because we now use reflection,
Eventually/Consistently can be methods.
2026-01-07 14:11:33 +01:00
Patrick Ohly
c47ad64820 DRA e2e+integration: test ResourceSlice controller
The "create 100 slices" E2E sometimes flaked with timeouts (e.g. 95 out of 100
slices created). It created too much load for an E2E test.

The same test now uses ktesting as API, which makes it possible to run it as
integration test with the original 100 slices and with more moderate 10 slices
as E2E test.
2026-01-07 14:11:33 +01:00
Patrick Ohly
047682908d ktesting: replace Begin/End with TContext.Step
Manually pairing Being with End is too error prone to be useful. It had the
advantage of keeping variables created between them visible to the following
code, but that doesn't justify using those calls.

By using a callback we can achieve a few things:

- Code using it automatically shadows the parent tCtx, thus enforcing
  that within a code block the tCtx with step is used consistently.
- The code block is clearly delineated with curly braces.
- When the code block ends, the unmodified parent tCtx is automatically
  in scope again.

Downsides:

- Extra boilerplate for the anonymous function.
  Python's `with tCtx.Step(...) as tCtx: ` would be nicer.
  As an approximation of that `for tCtx := range tCtx.Step(...)` was
  tried with `Step` returning an iterator, but that wasn't very idiomatic.
- Variables created inside the code block are not visible outside of it.
2026-01-07 14:11:33 +01:00
Patrick Ohly
d17aaf5e29 e2e: suppress or ignore init log output
klog calls during init are becoming a problem because now test/e2e/framework
depends in test/utils/ktesting which bumps up the default verbosity during init
to make test output more complete when there is no argument parsing.

For cadvisor, an upstream fix is
needed (https://github.com/google/cadvisor/pull/3778). For kubectl we can make
it silently accept the valid (!) LC_ALL=C.
2026-01-07 14:11:33 +01:00
Patrick Ohly
de47714879 DRA upgrade/downgrade: rewrite as Go unit test
tCtx.Run and sub-tests make it much simpler to separate the different steps
than with Ginkgo because unless a test runs tCtx.Parallel (which we don't do
here), everything runs sequentially in a deterministic order.

Right now we get:

    ...
        localupcluster.go:285: I1210 12:24:22.067524] bring up v1.34: stopping kubelet
        localupcluster.go:285: I1210 12:24:22.067548] bring up v1.34: stopping kube-scheduler
        localupcluster.go:285: I1210 12:24:22.067570] bring up v1.34: stopping kube-controller-manager
        localupcluster.go:285: I1210 12:24:22.067589] bring up v1.34: stopping kube-apiserver
    --- PASS: TestUpgradeDowngrade (94.78s)
        --- PASS: TestUpgradeDowngrade/after-cluster-creation (2.07s)
            --- PASS: TestUpgradeDowngrade/after-cluster-creation/core_DRA (2.05s)
            --- PASS: TestUpgradeDowngrade/after-cluster-creation/ResourceClaim_device_status (0.02s)
        --- PASS: TestUpgradeDowngrade/after-cluster-upgrade (4.10s)
            --- PASS: TestUpgradeDowngrade/after-cluster-upgrade/core_DRA (4.09s)
            --- PASS: TestUpgradeDowngrade/after-cluster-upgrade/ResourceClaim_device_status (0.01s)
        --- PASS: TestUpgradeDowngrade/after-cluster-downgrade (1.24s)
            --- PASS: TestUpgradeDowngrade/after-cluster-downgrade/core_DRA (1.21s)
            --- PASS: TestUpgradeDowngrade/after-cluster-downgrade/ResourceClaim_device_status (0.02s)
    PASS

It's even possible to use `-failfast` and
e.g. `-run=TestUpgradeDowngrade/after-cluster-creation/core_DRA`: `go test` then
runs everything up to that sub-test or any failing sub-test, then stops and
cleans up.
2026-01-07 14:11:33 +01:00
Patrick Ohly
7c7b1e1018 DRA e2e: make driver deployment possible in Go unit tests
This leverages ktesting as wrapper around Ginkgo and testing.T to make all
helper code that is needed to deploy a DRA driver available to Go unit
tests and thus integration tests.

How to proceed with unifying helper code for integration and E2E testing is
open. This is just a minimal first step in that direction. Ideally, such
code should be in separate packages where usage of Ginkgo, e2e/framework
and gomega.Expect/Eventually/Consistently are forbidden.

While at it, the builder gets extended to make cleanup optional.
This will be needed for upgrade/downgrade testing with sub-tests.
2026-01-07 14:11:33 +01:00
Marek Siarkowicz
fd2083450a Cleanup WatchFromStorageWithoutResourceVersion feature gate 2026-01-07 13:57:11 +01:00
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
Tanner
bb8b4b0d80 Correct the usage of vlog's .Error() or .V().Info() methods 2026-01-06 20:31:04 -05:00
Neeraj Krishna Gopalakrishna
92129d36bf Add negative validation for imageMinimumGCAge 2026-01-07 06:56:14 +05:30
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
Tim Allclair
414f4e2770 Remove unused Snapshot config source modes. 2026-01-06 15:00:19 -08:00
Tim Allclair
fa1dfe4181 Clean up config source update merging: remove code handling unused
update types.
2026-01-06 14:59:48 -08:00
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
Lalit Chauhan
4e6aafb9b3 Address feedbacks 2026-01-06 18:38:35 +00:00
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
Lalit Chauhan
e83723ce2c Add ignoreConversionErrors option to validation testing
This commit adds an 'IgnoreObjectConversionErrors' option to the
validation testing framework in 'k8s.io/apimachinery' and exposes it
via 'pkg/api/testing'.

This is useful for fuzzing tests where we might want to skip object
versions that cannot be converted from the internal version (e.g. due to
missing fields or incompatible types in older versions) but still want
to test validation for the versions that *can* be converted.

The 'autoscaling' group versions are added to 'TestVersionedValidationByFuzzing'
with this option enabled.
2026-01-06 18:23:26 +00:00
Richa Banker
de68e0ae8b Update metrics docs list for v1.35 2026-01-06 09:25:56 -08:00
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
Harshal Patil
a770f8342d Sort runtime handlers list coming from the CRI runtime
Signed-off-by: Harshal Patil <12152047+harche@users.noreply.github.com>
2026-01-05 14:56:42 -05:00
Harshal Patil
1e71a25950 Fix race condition in DRA health e2e test pod status update
Signed-off-by: Harshal Patil <12152047+harche@users.noreply.github.com>
2026-01-05 14:13:40 -05:00
Patrick Ohly
65ef31973c DRA upgrade/downgrade: split out individual test steps
This approach with collecting results from callbacks in a main ginkgo.It and
using them as failures in separate ginkgo.It callbacks might be the best that
can be done with Ginkgo.

A better solution is probably Go unit tests with sub-tests.
2026-01-05 13:45:03 +01:00
Patrick Ohly
47b613eded e2e framework: support creating TContext
This makes it possible to call helper packages which expect a TContext from E2E
tests.

The implementation uses GinkgoT as TB and supports registering cleanup
callbacks which expect a context. These callbacks then run with a context that
comes from ginkgo.DeferCleanup, just as if they had called that directly.
2026-01-05 13:45:03 +01:00
Patrick Ohly
dab76ef8de ktesting: add namespace support
Many helper packages need to know the test namespace in addition to the client.
Supporting passing of that information through the TContext avoids adding
another parameter to such helper packages.

This mirrors similar functionality in framework.Framework which also provides
a namespace to the test and packages taking such a parameter.
2026-01-05 13:45:03 +01:00
Patrick Ohly
57ae8e991a ktesting: safer RESTConfig()
Instead of granting callers access to the instance stored in the context,
let's return a copy. Otherwise a caller might accidentally modify what is
stored in the context when they forget to make a copy themselves before
modifying fields.
2026-01-05 13:45:03 +01:00