858 Commits
Author SHA1 Message Date
Dan Winship 562bc43ae4 Fix TCP_CLOSE_WAIT test to use agnhost rather than distroless-iptables
Originally, this test used the conntrack binary to check the conntrack
state, so it used the distroless-iptables image (the base of the
kube-proxy image) as a helper, since that contained the conntrack
binary. But later, we removed conntrack from that image after
kube-proxy no longer needed it, and the test got updated to read
/proc/net/nf_conntrack directly. Thus, there is no longer any reason
to be using distroless-iptables (and forcing the distroless-iptables
image to contain "sleep", "cat", and "grep").

(The test still had code to use the conntrack binary if
/proc/net/nf_conntrack was unavailable, but this fallback would never
be used because the image it was using never contained that binary.)
2026-11-03 14:28:41 -05:00
Yongrui Lin 9c1235e9d5 Use k8s.io/apiextensions-api for CRD types and clients
Code that needs the conversions to the internal version still imports
them from k8s.io/apiextensions-apiserver.
2026-10-27 23:16:06 +00:00
Nabarun Pal 571c387941 Bump images and versions to Go 1.27.3 and update distroless-iptables
Signed-off-by: Nabarun Pal <pal.nabarun95@gmail.com>
2026-10-22 17:43:17 +05:30
Marko Mudrinić b4213f9b62 Bump images and versions to Go 1.27.2 and update distroless-iptables
Signed-off-by: Marko Mudrinić <mudrinic.mare@gmail.com>
2026-10-16 23:53:54 +02:00
Patrick Ohly 1db4ec48fe testing: enforce usage of interface instead of testing.T/TB
Production code should not depend on the testing package. Helper packages
should be more flexible and support other implementations like
ktesting.TContext.

Valid exceptions are type assertions.
2026-10-14 15:30:29 +02:00
Patrick Ohly 6166137e40 test: avoid hard dependency on testing.T/TB
This makes the test helper code more flexible. In particular, passing a
ktesting.TContext instance is okay: it implements all required methods, but
isn't *testing.T and cannot implement testing.TB (private method).

Instead of a new testutils.TB interface, ktesting.TB could have been used. This
is not done because TContext usage should go together with other changes (for
example, merging with ctx or client parameters and renaming to tCtx). That can
be done later if desired.

A potential downside of the custom interface, loosing printf checking, gets
avoided by making the connection to testing.T visible.
2026-10-14 15:16:59 +02:00
Patrick Ohly c13f052503 ktesting: move to staging
This moves the existing code unchanged, updates package and module name, and
updates all import statements.
2026-10-07 11:08:22 +02:00
kubernetes-prow[bot] 8f58e1b59b Merge pull request #142488 from dims/bump-e2e-test-images
Bump e2e test images and CSI sidecars to promoted versions
2026-09-28 21:43:13 +00:00
Davanum Srinivas 5a10248559 test/utils/image: bump e2e test images to promoted versions
apparmor-loader   1.4    -> 1.6.0
kitten            1.8    -> 1.9
nautilus          1.8    -> 1.9.0
nonroot           1.5    -> 1.6.0
resource-consumer 1.14   -> 1.15.0
sample-apiserver  1.29.2 -> 1.33.8

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2026-09-28 12:50:34 -04:00
jubittajohn c08a2dbabe Update sample-device-plugin image manifest to 1.8.0
Signed-off-by: jubittajohn <jujohn@redhat.com>
2026-09-28 12:14:46 -04:00
Adonis Murati cc8de4ab38 test: restrict CA key encipherment usage to RSA
Remove KeyEncipherment from ECDSA certs in pod cert and log tests.
Add test for pki helpers after the update in pki helpers.

Signed-off-by: Adonis Murati <adonismurati@gmail.com>
2026-09-22 14:13:26 +02:00
Carlos Panato 248bd2c871 Bump images and versions to go 1.27.1 and distroless iptables
Signed-off-by: Carlos Panato <ctadeu@gmail.com>
2026-09-17 13:39:48 +02:00
Patrick Ohly f098aa5a56 ktesting: remove dependency on apiextensions
Supporting the apiextensions client was done for the sake of completeness, but
would extend the set of dependencies of client-go. That isn't worth it, in
particular considering that tests which need this can easily construct the
client locally.
2026-09-16 14:43:27 +02:00
kubernetes-prow[bot] e5f62fbfa6 Merge pull request #142012 from everettraven/upstream/deps/go-oidc-jose
update go-jose and go-oidc packages to latest versions
2026-09-14 21:45:19 +00:00
Bryce Palmer 592878d515 update gofmt
Signed-off-by: Bryce Palmer <bpalmer@redhat.com>
2026-09-14 13:30:55 -04:00
Patrick Ohly e09240c0ca ktesting: reorganize tests
Tests get moved into files matching the implementation.
Test coverage is at 89.6% with or without this change, so
no test got lost.
2026-09-11 20:04:47 +02:00
Patrick Ohly 2603d5b5a2 ktesting: reorganize implementation code
The goal is to make it easier to read the source top-to-bottom.
The previous organization had historic reasons.

The structure is now:
- doc.go: package docs
- tcontext.go: TContext and most of its methods
- assert.go: Gomega integration
- signal*.go: signal handling, including progress reporting
- contexthelper.go: utility code
- ktesting.go: global setup and compatibility with klog's ktesting

This was done purely via copy-and-paste, with one exception: run(tCtx, ...)
became tCtx.run and the comment was dropped because it was obvious.

Tests were not touched and still pass.
2026-09-11 20:04:47 +02:00
Patrick Ohly 6b0891e067 ktesting: fix missed auto-cancellation for Run/SyncTest sub-tests
Init cancels its TContext automatically when the test ends, via
runWhenDone (context.AfterFunc on the test's own context). withTB,
used by TContext.Run for sub-tests, never set this up, so a
sub-test's TContext was only canceled when the whole parent test
finished, not when that sub-test itself ended. Found when using the new
ktesting semantic more widely.

SyncTest has a related but distinct problem: even with the above
fixed, automatic cancellation via context.AfterFunc runs the
callback in a new goroutine, but synctest checks for durably
blocked goroutines the instant the bubble's main goroutine returns,
with no guarantee that the AfterFunc goroutine ran in time. Fixed
by canceling synchronously via defer around the callback instead.
2026-09-10 21:11:17 +02:00
Bryce Palmer d3340f4586 update go-jose import strings to v4
Signed-off-by: Bryce Palmer <bpalmer@redhat.com>
2026-09-10 12:12:41 -04:00
Patrick Ohly 55e52689be ktesting: enhance progress reporting
Currently running tests are tracked and their names are shown for
progress reports generated inside them.

As before, once we intercept the Ginkgo spec context, the result is
not a full ginkgo.SpecContext. That's okay because Gomega only needs
AttachProgressReporter. The cleanup test was checking for more than
that and therefore needs to be updated.
2026-09-10 15:41:30 +02:00
Patrick Ohly 2c05cf5d90 ktesting: also change logger in WithStep
To make the output `tCtx.Log` and `tCtx.Logger().Info` consistent, the logger
has to be updated via WithName and (because that is how WithName is implemented
in the klog test logger) the tCtx.Log output must switch from ": " to "/" as
separator.
2026-09-09 17:09:23 +02:00
Patrick Ohly 2139d4a7f7 ktesting: improve capturing backtraces
Code which wants to return an error with backtrace can now create one via
NewFailure.

Test failures (both direct and via Gomega) now also capture the backtrace when
wrapped with WithError, which is then shown by ExpectNoError. Log output for
an unexpected error is more concise.
2026-09-09 17:09:23 +02:00
Patrick Ohly 49a1c49055 ktesting: docs and example update
This adds the same README.md to all ktesting packages for visitors of the
GitHub repo. The actual documentation is inside the Go doc comments.

The package doc of the main ktesting package is meant to be a full introduction
of all concepts, including those that are implemented elsewhere.

Doing a full pass over the entire functionality and examples led to some TODOs
around bugs and enhancements. Those will be addressed separately.
2026-09-09 17:09:23 +02:00
kubernetes-prow[bot] 6242a573e2 Merge pull request #141545 from pohly/ktesting-cancellation
ktesting: cancel the TContext as soon as the test is done
2026-09-07 12:48:27 +00:00
Patrick Ohly 94befd9f5d ktesting: cancel the TContext as soon as the test is done
This became possible when Context was added to the testing package. Before,
Init could only cancel the context when its cleanup function was invoked, which
is after the test ended.

Canceling exactly when the test ends is more natural because then all cleanup
functions registered by a test can wait for code started inside the test to
stop without having to call tCtx.Cancel explicitly first. Those workarounds
will removed separately, they remain valid because TContext.Cancel is
idempotent.

However, this is still a breaking change for code which depends on the TContext
*not* being canceled yet when a TContext.Cleanup callback is invoked. Such code
must be moved into a defer callback of the main test function. In more
complicated cases when a helper wants to run such code, it has to manage the
cancellation order itself.
2026-09-07 13:21:37 +02:00
kubernetes-prow[bot] 9b634252c6 Merge pull request #141032 from humblec/update-etcd-image-3.7.1
etcd: update etcd image to v3.7.1
2026-09-04 04:20:18 +00:00
Jordan Liggitt 09c276b884 Shift etcd testserver configuration to modifying functions 2026-09-02 15:22:25 -04:00
Humble Devassy Chirammal bc0b8a75d5 etcd: update etcd image to v3.7.1
Update etcd images to v3.7.1 across build dependencies, kubeadm defaults,
GCE manifests, test manifests, and sample-apiserver deployment.

Signed-off-by: Humble Devassy Chirammal <humble.devassy@gmail.com>
2026-09-02 20:33:39 +05:30
Patrick Ohly 11b8342bed ktesting: add CancelBecause
CancelBecause is an alternative to the existing Cancel which allows the caller
to control the entire cancellation cause. This can be useful for propagating
the cause of one context to another.

While at it, refactor such that canceledError is used in fewer places.
2026-09-01 12:11:38 +02:00
Davanum Srinivas 50f3f436f1 test/images: bump agnhost to 2.66.1, nginx and glibc-dns-testing
Switch e2e tests to the freshly promoted test images:

- agnhost 2.66.1
- nginx 1.27.0-2 and 1.28.0-2
- glibc-dns-testing 2.1.1

Promoted in kubernetes/k8s.io#9787 and kubernetes/k8s.io#9788.
All four tags verified live on registry.k8s.io with digests
matching the promotion manifests.

The agnhost bump follows build/dependencies.yaml refPaths: the
manifest.go config, the kitten and nautilus BASEIMAGE files, and
the yaml fixtures that hardcode the tag.

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2026-07-29 13:28:20 -07:00
zylxjtu 4ea5c1759e e2e/auth: use FQDN for mTLS client fetch URL
The Projected PodCertificate mTLS test built the client fetch URL from
the partially qualified name "server.<namespace>.svc". Windows pods
treat any name containing a "." as an FQDN and skip DNS search-suffix
resolution, so partially qualified service names do not resolve there.

Build the fetch URL from the fully qualified service name using the
cluster DNS domain so the client resolves the server on both Linux and
Windows.
2026-07-28 16:19:05 +00:00
tinatingyu 57c6b19abb Promote PodCertificateRequest to GA (v1)
TAG=agy
CONV=723dea2c-bfd6-42fc-a230-4d238ac6191c
2026-07-21 17:17:06 +00:00
Stanislav Láznička 66e2db60b3 use the new GA CTB API
Signed-off-by: Stanislav Láznička <slznika@microsoft.com>
2026-07-17 09:21:24 +02:00
kubernetes-prow[bot] a0b3d14d27 Merge pull request #138946 from servusdei2018/master
test/utils/ktesting: make CleanupGracePeriod configurable in TContext
2026-07-16 10:37:33 +00:00
kubernetes-prow[bot] 71e965b9e9 Merge pull request #137580 from vinayakray19/bug/issue-#137520
Register sample-device-plugin image in manifest
2026-07-16 10:37:25 +00:00
Dan Winship a9a8281ba7 Use new distroless-iptables v0.9.4 with nft 1.0.6.1 2026-07-14 08:59:07 -04:00
Jefftree 5836a6111f etcd: update etcd image to v3.7.0 2026-07-08 16:07:09 -04:00
kubernetes-prow[bot] 2f448e8d98 Merge pull request #139789 from suii2210/bump-agnhost-2.66.0
test/images/agnhost: bump to 2.66.0
2026-07-08 03:02:25 +00:00
arkadeepsen 843c638b85 Promote regression-issue-74839 to 1.5
Signed-off-by: arkadeepsen <arsen@redhat.com>
2026-07-03 18:15:44 +05:30
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
suii2210 5ff0525cae test/images/agnhost: bump to 2.66.0 2026-06-16 15:13:12 +00:00
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