Commit Graph

787 Commits

Author SHA1 Message Date
Carlos Panato
02c02b91a7 Bump images and versions to go 1.26.4 and distroless iptables
Signed-off-by: Carlos Panato <ctadeu@gmail.com>
2026-06-09 12:51:12 +02:00
Ed Bartosh
891a905031 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-04-23 08:27:36 +02:00
Ed Bartosh
1d850e8427 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-04-23 08:27:36 +02:00
Ed Bartosh
62d05adc8b 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-04-23 08:27:36 +02:00
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
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
joshjms
7c54689847 etcd: update etcd image to v3.6.8
Signed-off-by: joshjms <joshjms1607@gmail.com>
2026-02-18 21:29:56 +08:00
Kubernetes Prow Robot
5b63a8c68e Merge pull request #136921 from dims/dump-from-utils
Move dump package from apimachinery to k8s.io/utils
2026-02-12 22:28:10 +05:30
Carlos Panato
634d1f00ab Bump images and versions to go 1.25.7 and distroless iptables
Signed-off-by: Carlos Panato <ctadeu@gmail.com>
2026-02-12 14:04:23 +01:00
Davanum Srinivas
550cc8645b 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>
2026-02-12 07:34:19 -05:00
Kubernetes Prow Robot
54489c1a33 Merge pull request #136729 from ahmedtd/podcert-pkcs10
Pod Certificates: Add StubPKCS10Request; migrate in-tree usages
2026-02-12 04:43:59 +05:30
Arda Güçlü
ccd53e4eeb Reflect expected replica count to the output of kubectl scale 2026-02-11 17:44:36 +03:00
Kubernetes Prow Robot
8b09f925a7 Merge pull request #130918 from iPraveenParihar/e2e/add-snapshot-metadata
Add E2E tests for CSI Snapshot Metadata functionality
2026-02-11 19:10:01 +05:30
Kubernetes Prow Robot
2023f445ec Merge pull request #136291 from atombrella/feature/modernize_rangeint_test_integration_utils
Use Go 1.22 for-range in test/{utils,integrations}
2026-02-06 20:16:32 +05:30
Taahir Ahmed
26a78bab27 Pod Certificates: Add StubPKCS10Request; migrate in-tree usages to it 2026-02-05 16:27:54 -08:00
Kubernetes Prow Robot
dab5f4f0ae Merge pull request #136777 from omerap12/update-agnhost
Upgrade agnhost image to 2.63.0
2026-02-06 00:44:38 +05:30
Omer Aplatony
201fe11b03 Promote agnhost image to 2.63.0
Signed-off-by: Omer Aplatony <omerap12@gmail.com>
2026-02-05 17:21:34 +00:00
Mads Jensen
cb7f56f30d Use Go 1.22 for-range in test/utils and test/integrations
This was changed using modernize/rangeint.
2026-02-05 16:13:58 +01:00
Praveen M
a74bf84787 e2e: add tests for external-snapshot-metadata sidecar
The tests validate the sidecar's functionality,
integration with the CSI driver and correctness of
metadata retrieval for snapshot backups.

This will help CSI vendors test their implementation
of the snapshot-metadata feature.

Issue: kubernetes-csi/external-snapshot-metadata#120

Signed-off-by: Praveen M <m.praveen@ibm.com>
2026-02-05 15:02:40 +05:30
Patrick Ohly
61a08b94dc ktesting: remove deprecated and unused functions
They were replaced with methods and after their usage got updated can now also
be removed.
2026-02-02 16:35:11 +01:00
Kubernetes Prow Robot
eba75de156 Merge pull request #136341 from Karthik-K-N/remove-deprecated-methods
Remove usage of deprecated functions from ktesting package
2026-02-02 19:28:31 +05:30
Patrick Ohly
36bcd43fca ktesting: abort entire test suite on SIGINT
When aborting an integration test with CTRL-C while it runs,
the current test fails and etcd exits. But additional tests were still being
started and the failed slowly because they couldn't connect to etcd.

It's better to fail additional tests in ktesting.Init when the test run has
already been interrupted.

While at it, also make it a bit more obvious that testing was interrupted by
logging it and update one comment about this and clean up the naming of
contexts in the code.

Example:

    $ go test -v ./test/integration/quota
    ...
    I1106 11:42:48.857162  147325 etcd.go:416] "Not using watch cache" resource="events.events.k8s.io"
    I1106 11:42:48.857204  147325 handler.go:286] Adding GroupVersion events.k8s.io v1 to ResourceManager
    W1106 11:42:48.857209  147325 genericapiserver.go:765] Skipping API events.k8s.io/v1beta1 because it has no resources.
    ^C

    INFO: canceling test context: received interrupt signal

    {"level":"warn","ts":"2024-11-06T11:42:48.984676+0100","caller":"embed/serve.go:160","msg":"stopping insecure grpc server due to error","error":"accept tcp 127.0.0.1:44177: use of closed network connection"}
    ...
    I1106 11:42:50.042430  147325 handler.go:142] kube-apiserver: GET "/apis/rbac.authorization.k8s.io/v1/clusterroles" satisfied by gorestful with webservice /apis/rbac.authorization.k8s.io/v1
        test_server.go:241: timed out waiting for the condition
    --- FAIL: TestQuota (11.45s)
    === RUN   TestQuotaLimitedResourceDenial
        quota_test.go:292: testing has been interrupted: received interrupt signal
    --- FAIL: TestQuotaLimitedResourceDenial (0.00s)
    === RUN   TestQuotaLimitService
        quota_test.go:418: testing has been interrupted: received interrupt signal
    --- FAIL: TestQuotaLimitService (0.00s)
    FAIL
2026-01-30 12:35:57 +01:00
Patrick Ohly
8946e86e3a ktesting: properly clean up
When cleaning up the progress channel properly (stop signal delivery, closing
the channel), the loop dumping progress reports no longer needs to check for
the separate shutdown context. Instead, it can distinguish between "signal
received" and "channel closed".

The signal context was getting cleanup by canceling it, but a channel is better
because it avoids the slightly misleading "received interrupt signal"
cancellation when the test was only shutting down.
2026-01-30 12:35:57 +01:00
Patrick Ohly
d0141640fe ktesting: print info and progress to /dev/tty
The "received interrupt signal" is useful also when running with "go test"
without -v because it shows that the shutdown has started.

But more important is that a progress report gets shown because that feature is
useful in particular when "go test" produces no output while it runs.
2026-01-30 12:35:57 +01:00
Karthik Bhat
e44e06c53f Remove usage of deprecated functions from ktesting package 2026-01-29 14:51:59 +05:30
Kubernetes Prow Robot
091d147008 Merge pull request #136557 from pohly/ktesting-signal-cleanup
ktesting: progress reporting fix
2026-01-28 15:32:00 +05:30
Patrick Ohly
65693b2d2a ktesting: fix setting up progress reporting
The recent change to support importing ktesting into an E2E suite
without progress reporting was flawed:
- If a Go unit test had a deadline (the default when invoked
  by `go test`!), the early return skipped initializing progress
  reporting.
- When it didn't, for example when invoking a test binary directly
  under stress, a test created goroutines which were kept running,
  which broke leak checking in e.g. an integration tests TestMain.

The revised approach uses reference counting: as long as some unit test is
running, the progress reporting with the required goroutines are active.
When the last one ends, they get cleaned up, which keeps the goleak
checker happy.
2026-01-27 10:13:43 +01:00
Patrick Ohly
d91be59690 ktesting: run time-sensitive unit tests as synctest
The TestCause tests were already unreliable in the CI. The others failed under
stress.

As synctest we have to be more careful how to construct and clean up the parent
context for TestCause (must happen inside bubble), but once that's handled we
can reliably measure the (fake) time and compare exactly against expected
results.
2026-01-27 09:18:10 +01:00
Carlos Panato
5e54532bf4 Bump images and versions to go 1.25.6 and distroless iptables
Signed-off-by: Carlos Panato <ctadeu@gmail.com>
2026-01-26 18:04:17 +01:00
Mads Jensen
757647786d Remove redundant re-assignments in for-loops in test/{e2e,integration,utils}
The modernize forvar rule was applied. There are more details in this blog
post: https://go.dev/blog/loopvar-preview
2026-01-25 22:58:27 +01:00
Davanum Srinivas
bceadbece2 Bump e2e test images to latest promoted versions
Image updates:
- ipc-utils: 1.3 → 1.4
- kitten: 1.7 → 1.8
- nautilus: 1.7 → 1.8
- nginx: 1.14-4 → 1.15-4
- nginx (new): 1.15-4 → 1.27-0
- node-perf/npb-ep: 1.2 → 1.6.0
- node-perf/npb-is: 1.2 → 1.7.0
- nonewprivs: 1.3 → 1.4
- nonroot: 1.4 → 1.5
- resource-consumer: 1.13 → 1.14
- volume/nfs: 1.4 → 1.6.0
- volume/iscsi: 2.6 → 2.7

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2026-01-23 06:19:30 -05:00
Davanum Srinivas
00e1a2e9a2 Switch node perf tests from TensorFlow to PyTorch Wide-Deep
Replace the TensorFlow-based wide-deep workload with the PyTorch
implementation. This change:

- Adds pytorchWideDeepWorkload using the new pytorch-wide-deep image (1.0.0)
- Removes tfWideDeepWorkload and tf-wide-deep image references
- Enables arm64 support (PyTorch image is multi-arch)
- Uses the same log parsing (time -p output format)

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2026-01-22 12:02:58 -05:00
Davanum Srinivas
0183b5547a test: update code to use GlibcDnsTesting image
Updates the codebase to use the new glibc-dns-testing image which replaces
the deprecated jessie-dnsutils image.

This PR depends on the glibc-dns-testing image being available in the
registry (registry.k8s.io/e2e-test-images/glibc-dns-testing:2.0.0).

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2026-01-22 08:39:46 -05:00
Kubernetes Prow Robot
daf12cc0f3 Merge pull request #136297 from dims/update-agnhost-etcd-versions
Update agnhost to 2.61 and etcd to 3.6.7-0 in test manifests
2026-01-19 22:31:56 +05:30
Patrick Ohly
fda3bdbd5e DRA tests: stop using deprecated ktesting functions
Some of them were already converted previously, but didn't take full advantage
of the more flexible methods: errors can be checked again by Gomega.
2026-01-19 08:27:15 +01:00