Commit graph

816 commits

Author SHA1 Message Date
Kubernetes Prow Robot
e7c90e9b46
Merge pull request #139785 from pohly/scheduler-perf-runners-refactor
test: move code under scheduler_perf
2026-06-16 21:25:27 +05:30
Patrick Ohly
24bf142113 test: move code under scheduler_perf
Some code in test/utils/runners.go was only used by scheduler_perf.
Therefore it belongs under test/integration/scheduler_perf where it can be
maintained by SIG Scheduling.
2026-06-16 15:20:43 +02:00
Jitesh Kumar
7bc0a4a16d test/images/agnhost: bump to 2.65.0
The new version includes a generic /envvar endpoint in netexec that
reads any named environment variable, enabling e2e tests to retrieve
spec.nodeName via the Downward API instead of relying on os.Hostname().

Ref: https://github.com/kubernetes/k8s.io/pull/9608
Signed-off-by: Jitesh Kumar <jiteshkumardj@gmail.com>
2026-06-16 00:05:07 +05:30
zylxjtu
0f457ea8c5 Bump up version of test image
This is to bump up the test image version for busybox and nginx/nginxnew
to version which have the windows2025 support.
2026-06-10 20:35:25 +00:00
Kubernetes Prow Robot
f7a260bfc5
Merge pull request #139609 from amritansh1502/promote-agnhost-2.64.0
Promote agnhost e2e test image to 2.64.0
2026-06-10 23:09:06 +05:30
Amritansh Amritansh
64915c6459 Promote agnhost e2e test image to 2.64.0 2026-06-10 14:18:35 +05:30
Carlos Panato
dbe3ee8f44
Bump images and versions to go 1.26.4 and distroless iptables
Signed-off-by: Carlos Panato <ctadeu@gmail.com>
2026-06-09 11:51:56 +02:00
Kubernetes Prow Robot
ded7d88452
Merge pull request #139360 from bart0sh/PR237-DRA-exclude-Kubelet-from-FG-Toggle
test/e2e_dra: don't toggle locked gates for Kubelet
2026-06-02 19:03:50 +05:30
Ed Bartosh
0744d39de8 test/e2e_dra: don't toggle locked gates for Kubelet
Kubelet lacks --emulated-version support and cannot toggle feature gates
that are locked in the binary. Modified ToggleFeatureGates to exclude
locked feature gates from kubelet's --feature-gates.
2026-06-02 12:58:09 +03:00
Jefftree
2544f4dda2 etcd: update etcd image to v3.7.0-rc.0 2026-06-01 20:29:57 -04:00
Kubernetes Prow Robot
04976d6f60
Merge pull request #138844 from skitt/bump-tools
Bump all tool dependencies
2026-05-20 01:31:45 +05:30
Kubernetes Prow Robot
e7d98b4f9b
Merge pull request #138791 from bart0sh/PR234-DRA-feature-gate-tests
e2e_dra: add DRAExtendedResource feature-gate on/off/on cycle test
2026-05-18 00:53:03 +05:30
Ed Bartosh
a7ad4ff5b3 localupcluster: support toggling feature gates
Allow feature gates to be applied at cluster (re)start.

- Added a featureGates parameter to Cluster.Start, merged into the command
  lines of kube-apiserver, kube-controller-manager, kube-scheduler and
  kubelet as they are launched by local-up-cluster.sh.
- Added ModifyOptions.FeatureGatesByComponent so Cluster.Modify can
  restart components with updated --feature-gates.
- Added mergeFeatureGatesFlags helper to merge new gates into a command line.
- Added unit tests for mergeFeatureGatesFlags
2026-05-13 19:39:39 +03:00
Kubernetes Prow Robot
300eda2f2f
Merge pull request #138746 from humblec/update-etcd-image-3.6.11
etcd: update etcd image to v3.6.11
2026-05-12 17:39:32 +05:30
Stephen Kitt
e223a05ec7
Bump github.com/vektra/mockery/v3
mockery ignores auto-generated code by default, so this requires a
couple of configuration changes.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2026-05-12 11:55:38 +02:00
Patrick Ohly
a2b0ea30b0 DRA upgrade/downgrade: run etcd directly
The local-up-cluster.sh script was used as proxy for controlling the etcd
lifecycle because the script was using a helper function that didn't support
dry-run mode. That approach was flawed in several ways, causing etcd to be left
running:

- Cmd.Stop wasn't actually called for the script by Cluster.Stop.
- If it had been called, the additional output during shutdown wouldn't
  have been processed, which might have caused the command to block instead
  of terminating (untested).
- It's unclear whether the script would have handled the signal properly.

A cleaner approach is to enable dry-run mode also in etcd .sh and then let
Cluster manage it like any other long-running process. Then we can let
local-up-cluster.sh terminate when it's done with its work. Cluster.Start can
check it's result immediately.
2026-05-04 09:24:47 +02:00
Humble Devassy Chirammal
ea67842860 etcd: update etcd image to v3.6.11
Update etcd images to v3.6.11 across build dependencies, kubeadm defaults,
GCE manifests, test manifests, and sample-apiserver deployment.

Signed-off-by: Humble Devassy Chirammal <humble.devassy@gmail.com>
2026-05-03 19:28:50 +05:30
Patrick Ohly
84190acdaa ktesting: move format package
The format package is used by ktesting, both to reconfigure Gomega and to
format errors, therefore it has to be moved to staging together with ktesting,
if or when we get to that because those are desirable features.

Because format only has the YAML package as additional dependency and that
should be okay for all other repos (except for the YAML package itself, of
course), we can publish the format package as a sub-package of such a future
ktesting module.

Avoiding the dependency on apimachinery to detect unstructured.Unstructured is
a bit tricky, but doable by relaxing what we check for. The test/utils/format
package is kept to test ktesting/format with the actual packages that it cannot
depend on (apimachinery, api).
2026-04-24 21:54:19 +02:00
Patrick Ohly
4d08a70a09 ktesting: remove usage of testify
It was only used for assertions in unit tests and can easily be replaced by
gomega. This reduces the set of ktesting dependencies.
2026-04-24 21:54:19 +02:00
Patrick Ohly
501a64df3f ktesting: rewrite log configuration
Depending on component-base/logs/testinit was convenient and avoided any doubts
about the init order, but isn't acceptable long-term as an additional
dependency because component-base is too big. The same functionality (flag
registration) can also be implemented directly in ktesting. Because Go 1.21
clarified the order in which independent packages get initialized, we know for
sure that "our" code runs after testinit and can handle a potential conflict.

While at it, introduce a KTESTING_VERBOSITY env variable to enable increasing
the default verbosity in CI jobs which run a mixture of tests where some don't
use ktesting and thus don't accept a -v=<something> parameter.
2026-04-24 21:54:19 +02:00
Patrick Ohly
b053208f76 ktesting: address linter hints
These hints showed for the client-go/ktesting because there the code is new.
They also apply exactly the same way to the old code, so both gets updated.
2026-04-24 21:54:19 +02:00
Patrick Ohly
67800794aa ktesting: create client-go/ktesting
The client-go variant of ktesting is a superset of the normal
ktesting, which makes it possible to get the full original
functionality simply by changing the import path.
2026-04-24 21:54:19 +02:00
Patrick Ohly
103b1086a5 WIP: ktesting: pass clients via WithValue
This enables passing the client-go clients and helpers via TContext.WithValue.

The advantage of this approach is that the implementation is small. The
downside is that all call sites need to be updated and need two imports. It's
also not discoverable from the TContext type that it may provide clients.

Only a few callers get updated to demonstrate the usage.
2026-04-24 21:54:19 +02:00
Patrick Ohly
dffbc4f839 ktesting: remove client-go dependency
The goal is to make ktesting available for unit testing in *all* Kubernetes
packages. To achieve that, it must not depend on packages which themselves
depend on other Kubernetes packages. client-go was the biggest of those
dependencies (but not the only one, see below), so it can't be part of the
TContext API.

How to to bring back passing of those values via a TContext is to be
decided. Options are:
- via WithValue
- by wrapping TContext

k8s.io/component-base/logs is another problematic dependency that is going to
be harder to resolve. Others are just work (testify!).

To prevent regressing accidentally, import-boss is now used to check
dependencies.
2026-04-24 21:54:18 +02:00
Patrick Ohly
bc2a34caae ktesting: more flexible WithContext
As a special case, WithContext preserved the logger in the parent context. But
for the upcoming usage of WithValue to store a Kubernetes client it is
important to also preserve access to other values.
2026-04-24 21:54:18 +02:00
Kubernetes Prow Robot
52e6ea169d
Merge pull request #138173 from pohly/ktesting-synctest-init
ktesting: support Init inside synctest bubble
2026-04-25 00:46:47 +05:30
Kubernetes Prow Robot
61723e7fa7
Merge pull request #138392 from humblec/update-etcd-image-3.6.10
etcd: update etcd image to v3.6.10
2026-04-23 17:28:45 +05:30
Kubernetes Prow Robot
2cb283315e
Merge pull request #137958 from bart0sh/PR227-localupcluster-check-readyz
localupcluster: properly query /readyz and /healthz, change cluster modification procedure
2026-04-23 04:15:37 +05:30
Humble Devassy Chirammal
d5c1f165c1 etcd: update etcd image to v3.6.10
Update etcd images to v3.6.10 across build dependencies, kubeadm defaults,
GCE manifests, test manifests, and sample-apiserver deployment.

Signed-off-by: Humble Devassy Chirammal <humble.devassy@gmail.com>
2026-04-15 16:18:52 +05:30
Marko Mudrinić
bf7ccb893e
Bump images and versions to go 1.26.2 and distroless iptables
Signed-off-by: Marko Mudrinić <mudrinic.mare@gmail.com>
2026-04-09 20:22:09 +02:00
Lubomir I. Ivanov
bc2179d882 pause: fix version drift in various files
The latest pause version is 3.10.2 but due to the introduction
of the PATCH level version to the pause image (previously was
only MAJOR.MINOR), various files have remained on an older
version. Either 3.10 or 3.10.1. Our validation with
build/dependencies.yaml ./hack/verify-external-dependencies.sh
did not account for that.
2026-04-03 16:11:09 +02:00
Patrick Ohly
4e91c01236 ktesting: support Init inside synctest bubble
Deadline is available inside a synctest bubble, but calling it panics. To
support constructing a TContext inside a bubble, we have to catch the panic
because there is no API to detect a bubble in advance. Detecting a panic is
then also used to set the result of TContext.IsSyncTest.

While at it, cleaning up the code a bit and adding unit tests for the Deadline
behavior.
2026-04-02 14:25:05 +02:00
Ed Bartosh
e3aa2b9b29 test/localupcluster: stop all components before starting replacements
Modify() was replacing components one at a time: stop X, start X, stop Y,
start Y, ... in version-skew order (apiserver last on downgrade). This
caused a crash during downgrade: KCM-1.35 started against the still-
running apiserver-1.36, passed its /healthz, and then immediately lose
its connection when apiserver-1.36 was killed by the localupcluster.
KCM-1.35 would reconnect to the not-yet-ready apiserver-1.35, hit a
403 RBAC error during controller initialization, and exit — because that
initialization phase does not retry on RBAC errors.

Fix by splitting Modify() into two phases:

  Phase 1 — stop all components to be replaced, in reverse startup order
  (kube-proxy down to apiserver), so dependent components release their
  connections before the apiserver is stopped.

  Phase 2 — start all replacement components in standard startup order
  (apiserver first), so each component connects to a fully-ready apiserver.
2026-03-26 12:40:47 +02:00
Ed Bartosh
51d0c8843d localupcluster: set readiness polling interval to 1 second
Without an explicit interval, Gomega's default polling is very frequent,
generating a large volume of /readyz and /healthz requests in the component
logs. Set an explicit 1-second interval to reduce noise while still
detecting readiness promptly.
2026-03-22 19:20:39 +02:00
Ed Bartosh
24c232d6b1 localupcluster: properly query /readyz and /healthz
Despite being called checkReadiness, the function was only performing
a liveness check: /healthz was polled over HTTPS without verifying the
certificate or authenticating, and any HTTP response was accepted as a
signal that the component was up. The only exception was kubelet,
where a node readiness check was added on top.

Switched to /readyz for kube-apiserver and kube-scheduler,
kept /healthz for the rest and require HTTP 200 in all cases.

This ensures that the kube-apiserver is fully initialized before
dependent components are started.
2026-03-22 19:20:33 +02:00
Patrick Ohly
3b63fe83a0 ktesting: support cancellation after WithoutCancel
Not canceling the parent context made sense, but the new context should
be cancelable like any other TContext. Found when passing tCtx.WithoutCancel()
to StartTestServer and the tear-down function got stuck because it couldn't
cancel the context.
2026-03-17 07:50:18 +01:00
kennangaibel
c19439f3f3
Support tls server name overrides in EgressSelectorConfiguration (#136640)
add integration test

Use proper test header, change to  etcdMain to recognize test flags

fix goroutine leak in integration test

redo integration test with kubeapiserverapptesting

fix comment capitalization, use existing client libraries

fix comment capitalization, use existing client libraries

consolidate http connect handler logic from odic and tls_server-name into helper

add expected SNI, remove unused test

move oidc helpers.go to right dir, remove copyright year

split helpers.go into descriptive file names

use atomic ptr for SNI, refactor generateTestCerts, remove errors from runTLSEgressProxy, explain jwksHandler in comment

use testify, add back context messages

Clean up tests

Signed-off-by: Monis Khan <mok@microsoft.com>
2026-03-11 23:53:35 +05:30
Kubernetes Prow Robot
519dbb1929
Merge pull request #137481 from pohly/PR224-fix-upgrade-downgrade-failures
DRA upgrade/downgrade: add some debug output for stopping commands
2026-03-10 20:21:13 +05:30
Kubernetes Prow Robot
2757a872ec
Merge pull request #137523 from enj/enj/f/constrained_impersonation_latency_metrics
KEP-5284: add impersonation latency tracking
2026-03-10 19:29:36 +05:30
Monis Khan
8a154c3d39
KEP-5284: add impersonation latency tracking
This change allows slow impersonation requests to be tracked via the
apiserver.latency.k8s.io/impersonation audit event annotation.

Updated tests to assert that the audit event log:

- Contains the new latency annotation
- Contains the impersonationConstraint field
- Failed impersonation attempts are observable by the response status

Signed-off-by: Monis Khan <mok@microsoft.com>
2026-03-09 19:58:31 -04:00
Kubernetes Prow Robot
63d25f42db
Merge pull request #136945 from ardaguclu/fix-kubectl-scale
Reflect expected replica count to the output of kubectl scale
2026-03-09 19:53:22 +05:30
Patrick Ohly
f692e4e8f0 DRA upgrade/downgrade: add some debug output for stopping commands
In some (all?) CI jobs the initial kubelet instance keeps running, despite
command context cancellation. Not reproducible locally, so additional output
was necessary to track down the root cause in CI runs: signal propagation via
sudo didn't work for kube-proxy and kubelet, but only for those two and only in
the CI. The fix is to change the CI jobs so that they disable the usage of
sudo.

While at it, simplify by replacing atomic.Pointer with atomic.Boole.
2026-03-09 10:40:33 +01:00
Kubernetes Prow Robot
3369e51e09
Merge pull request #137080 from cpanato/update-go-1.26
Bump dependencies, images and versions used to Go 1.26.0 and distroless iptables
2026-03-05 21:56:21 +05:30
Karthik Bhat
72609c329a Update example test to use tCtx Eventually 2026-02-27 10:03:29 +05:30
Patrick Ohly
c4c9a9d4de ktesting: remove type alias
The type alias made `go doc ./test/utils/ktesting.TContext` useless and was a
weird workaround for preserving the original interface type name. Passing a
TContext instance by value (almost) preserves the original API and is
acceptable because the struct is still small. The only consumers which need to
be updated are those which relied on passing nil as tCtx.

If we ever find that TContext is or becomes too large, then we can make it
a wrapper around some pointer.
2026-02-26 15:42:55 +01:00
Kubernetes Prow Robot
f60990d3f9
Merge pull request #136459 from Karthik-K-N/refactor
Refactor NewTestContext to return Context instead of TContext
2026-02-26 14:56:25 +05:30
Carlos Panato
d9956b7fde
Bump dependencies, images and versions used to Go 1.26.0 and distroless iptables
Signed-off-by: Carlos Panato <ctadeu@gmail.com>
2026-02-26 09:09:39 +01:00
Patrick Ohly
620c1b6305 ktesting: fix potential unit test flake
I've not been able to trigger the flake, but it could happen:
- time.Sleep unblocks some background goroutines inside the synctest bubble.
- Those goroutines do not actually run yet.
- The main test checks for the result of those goroutines.

Adding a `synctest.Wait` ensures that all background processing is complete
because it waits for all goroutines to be durably blocked.
2026-02-26 08:45:35 +01:00
Patrick Ohly
8a2d153817 ktesting: fix potential log panic
If the goroutine happens to log after the test has already terminated,
testing.T.Log panics. We must ensure that the goroutine has stopped before
allowing the test to terminate.
2026-02-26 08:44:18 +01:00
Karthik Bhat
43bfd8615d Refactor NewTestContext to return Context instead of TContext 2026-02-26 11:27:26 +05:30