Commit graph

3855 commits

Author SHA1 Message Date
Davanum Srinivas
1ee1ff97fb
staging: extract CRI streaming modules with client-go compatibility
Extract streaming code into dedicated staging modules while keeping stable
compatibility APIs for external client-go consumers.

This commit:
- adds `k8s.io/cri-streaming` for CRI exec/attach/portforward server code
- adds `k8s.io/streaming` as the canonical home for shared transport
  primitives (`httpstream`, `spdy`, `wsstream`, runtime helpers)
- switches in-tree transport consumers to `k8s.io/streaming`
- removes in-tree kubelet CRI streaming package
- preserves NO_PROXY/no_proxy CIDR handling in extracted SPDY proxier logic
- adds deprecated `k8s.io/apimachinery/pkg/util/httpstream` compatibility
  wrappers (`httpstream`, `spdy`, `wsstream`) backed by `k8s.io/streaming`
- restores exported client-go SPDY/portforward API signatures to
  apimachinery `httpstream` types for downstream compatibility
- adds streaming-native client-go adapters/constructors so in-tree callers
  can use `k8s.io/streaming` without changing external compatibility APIs
- deduplicates SPDY-over-websocket dial negotiation shared by compat and
  streaming tunneling dialers
- logs dropped unknown stream types in `RemoveStreams` adapter fallbacks to
  improve compatibility-path debuggability
- adds integration coverage for the streaming-upgrader-to-client-go-compat
  adapter path against a real cri-streaming exec endpoint
- clarifies kubectl streaming import aliasing to avoid `httpstream` package
  ambiguity
- updates tests, import restrictions, publishing metadata, and vendor/module
  metadata for the new staging modules

Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2026-03-12 09:59:55 -04:00
Kubernetes Prow Robot
08b192cdd1
Merge pull request #137626 from pohly/dra-e2e-with-kubelet-version
E2E framework: introduce WithKubeletMinVersion helper
2026-03-12 13:55:37 +05:30
Maciej Szulik
d11acb0d89
Re-use existing helper for port-forwarding in autoscaling utils
Signed-off-by: Maciej Szulik <soltysh@gmail.com>
2026-03-11 15:24:15 +01:00
Patrick Ohly
9d9f4ddd88 E2E framework: introduce WithKubeletMinVersion
This simplifies specifying the minimum required kubelet (a bit shorter overall,
harder to introduce typos because the string is shorter) and enables usage of
`--sem-ver-filter`.

Jobs that filter by label or text continue to work as before.

As a proof-of-concept, the DRA tests are labeled using the new helper
and are tested with canary jobs which use --sem-ver-filter. The normal
jobs which rely on the label still work.
2026-03-11 09:47:27 +01:00
Kubernetes Prow Robot
0fbb89c81c
Merge pull request #137535 from danwinship/nodeip-e2e-cleanups
e2e cleanups related to node IPs
2026-03-10 02:59:19 +05:30
Dan Winship
6ebabf3198 Fix the semantics of e2essh.NodeSSHHosts on error
If it failed to find an IP for every node, it returned a partial list
along with an error. However, (a) this should never happen since every
scheduleable node should have at least one usable IP, and (b) it
didn't matter since all of its callers just treat any error as being
fatal anyway. So just remove the special case.
2026-03-07 10:52:48 -05:00
Dan Winship
0ffb815750 Drop e2enode.FirstAddress
which was no longer used anyway
2026-03-07 10:45:07 -05:00
Dan Winship
b68e2ac8a5 Drop e2enode.PickIP(), fix its one caller
This returned a randomly-selected IP from across all nodes, preferring
ExternalIP but falling back to an InternalIP. But it was only called
from one place, which was connecting from inside the cluster and thus
wanted an InternalIP anyway.
2026-03-07 10:45:07 -05:00
Dan Winship
6302e3a94f Inline a Service jig helper into a test
jig.GetEndpointNodesWithIP was only used by one test, and that test
didn't even want the data in the form jig.GetEndpointNodesWithIP
provided it in. So just inline the code and generate the data
correctly the first time, and remove GetEndpointNodesWithIP (along
with GetEndpointNodes, which was already unused).
2026-03-07 10:45:06 -05:00
Mads Jensen
1f2b70a043 Lint: Use modernize/rangeint in test/{e2e,e2e_node,images,soak} 2026-03-07 10:17:31 +01:00
Jordan Liggitt
45900a1deb
Fix vet error 2026-03-05 18:11:02 -05:00
Kubernetes Prow Robot
691a44c3b5
Merge pull request #137119 from danwinship/dual-stack-tests
dual stack test fixups
2026-02-25 19:43:47 +05:30
Dan Winship
a401451df8 Drop NodeKiller
This was supposed to have been removed shortly after it was added (the
functionality was moved to kubernetes/perf-tests, where it has since
been improved).
2026-02-21 08:30:04 -05:00
Kubernetes Prow Robot
8812ec563c
Merge pull request #134353 from skitt/drop-string-slice
Deprecate obsolete slice utility functions
2026-02-20 00:57:41 +05:30
Dan Winship
8c9b2153e1 Remove some more dead code 2026-02-19 09:10:02 -05:00
Dan Winship
db71bd462f Remove test/e2e/framework/ingress
Nothing uses this any more (all the code that used it was removed
along with the GCP provider).
2026-02-19 09:10:02 -05:00
Dan Winship
755a7261ee Fix some dual-stack tests to use svc.Spec.IPFamilies 2026-02-18 13:52:36 -05:00
atilsensalduz
7e3bd4cfa5 chore(test/autoscaling): replace RC with ReplicaSet and update deprecated API versions in HPA e2e
Signed-off-by: atilsensalduz <atil.sensalduz@gmail.com>
2026-02-17 14:01:02 +03:00
Kubernetes Prow Robot
c99adcec1a
Merge pull request #136799 from omerap12/external-metrics-e2e
Add e2e test for external metrics
2026-02-16 19:44:02 +05:30
Stephen Kitt
d42d1e3d1f
Deprecate obsolete slice utility functions
... and update users to use standard library functions.

Signed-off-by: Stephen Kitt <skitt@redhat.com>
2026-02-16 10:04:33 +01:00
Kubernetes Prow Robot
7b21ce7c9a
Merge pull request #136905 from bart0sh/PR222-e2e-fix-extended-resource-flake
Fix extended resource flake
2026-02-11 21:56:02 +05:30
Ed Bartosh
02485d02ea DRA: e2e: move util_sampledevice.go to e2e/node/framework
- Moved sample device plugin constants and helper code to the
test/e2e/node/framework, so that both deviceplugin and DRA tests can
use it without creating e2e -> e2e_node dependency.

- Moved SampleDevsAmount constant from the
test/e2e_node/device_plugin_test.go
2026-02-11 16:07:17 +02:00
Mads Jensen
7883039b31 Remove unneeded use of fmt.Sprintf in test/{integration,e2e} 2026-02-08 14:34:13 +01:00
Omer Aplatony
d712e0e99c Add e2e test for external metrics
Signed-off-by: Omer Aplatony <omerap12@gmail.com>
2026-02-08 08:58:18 +00:00
Kubernetes Prow Robot
e74193bcbf
Merge pull request #135917 from zylxjtu/registry
Add the fake registry server functionality to agnhost windows
2026-02-04 07:56:28 +05:30
Kubernetes Prow Robot
e2ce7dfbce
Merge pull request #135788 from BenTheElder/etcd-tag
remove build tags from e2e internal unit test with etcd
2026-02-03 14:16:28 +05:30
Benjamin Elder
2d8a26a79c remove build tags from test e2e internal unittests 2026-02-02 11:35:53 -08:00
zylxjtu
979f73bf7d Add the fake registry server functionality to agnhost windows
there are recent changes in k8s e2e test for image pull test to switch
to use fake registry server,
https://github.com/kubernetes/kubernetes/pull/133272
https://github.com/kubernetes/kubernetes/pull/134453

Unfortunately, this does not take into account of windows node. so the
corresonding test on windows node strat to break

The try to address this issue, by
(1): update the agnhost windows image to include the fake registery server
functionality as well

(2): update the (common) pull image test to include windows node, will require
(a): deploy the agnhost faker register server as a HPC pod
(b): update the comanndline/options for the windows container specific
2026-02-02 19:00:29 +00: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
Patrick Ohly
dd78c81057 E2E framework ssh: avoid log spam in runSSHCommand
Emitting "error dialing" on each retry spams the test log output even when the
tests succeed.

Using Eventually also has other advantages (better failure message, support for
Gingko progress reports when a test is stuck).
2026-01-22 12:00:09 +01:00
Sotiris Salloumis
d9c3ec29ad Move getNodeAllocatableAndAvailableValues to framework
To allow use of this good method from future tests using
e2enode test framework.
2026-01-21 19:41:08 +01:00
Patrick Ohly
0c9c7ce40d E2E framework: fix nil pointer crash in TContext
Not all framework instances have a default namespace. TContext
crashed for those.

(cherry picked from commit 80cc14831e)

This got merged in https://github.com/kubernetes/kubernetes/pull/136140,
then reverted in https://github.com/kubernetes/kubernetes/pull/136151 and was
not brought back in https://github.com/kubernetes/kubernetes/pull/136156.
2026-01-19 10:51:24 +01:00
Patrick Ohly
4a3d822689 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.

(cherry picked from commit 7c7b1e1018)
2026-01-16 07:53:00 +01:00
Patrick Ohly
db36339d03 e2e framework: avoid memory overhead of ginkgo.GinkgoT
It turned out that ginkgo.GinkgoT() wasn't as cheap as it should have been (fix
coming in Ginkgo 2.27.5). When instantiated once for each framework.Framework
instance during init by all workers at the same time, the resulting spike in
overall memory usage within the container caused OOM killing of workers in Prow
jobs like ci-kubernetes-e2e-gci-gce with very tight memory limits.

Even with the upcoming fix in Ginkgo it makes sense to set the TB field only
while it really is needed, i.e. while a test runs. This is conceptually similar
to setting and unsetting the test namespace. It may help to flush out incorrect
usage of TB outside of tests.
2026-01-16 07:53:00 +01:00
Patrick Ohly
0d64cbff49 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.

(cherry picked from commit 47b613eded)
2026-01-16 07:53:00 +01:00
Patrick Ohly
e999d595b1 testing: partial revert of E2E + DRA upgrade/downgrade
Refactoring the DRA upgrade/downgrade testing such that it runs as Go test
depended on supporting ktesting in the E2E framework. That change worked during
presubmit testing, but broke some periodic jobs. Therefore the relevant commits
from https://github.com/kubernetes/kubernetes/pull/135664/commits get reverted:

c47ad64820 DRA e2e+integration: test ResourceSlice controller
047682908d ktesting: replace Begin/End with TContext.Step
de47714879 DRA upgrade/downgrade: rewrite as Go unit test
7c7b1e1018 DRA e2e: make driver deployment possible in Go unit tests
65ef31973c DRA upgrade/downgrade: split out individual test steps
47b613eded e2e framework: support creating TContext

The last one is what must have caused the problem, but the other commits depend
on it.
2026-01-11 09:55:17 +01:00
Patrick Ohly
80cc14831e E2E framework: fix nil pointer crash in TContext
Not all framework instances have a default namespace. TContext
crashed for those.
2026-01-09 16:23:11 +01:00
Kubernetes Prow Robot
26fd963327
Merge pull request #135664 from pohly/dra-upgrade-downgrade-refactor
DRA e2e: upgrade/downgrade refactor
2026-01-08 19:31:47 +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
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
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
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
1a866b8795 e2e framework: fix inconsistency in log output
Example:

    I1208 16:01:05.852628 243 upgradedowngrade_test.go:239] get source code version: bring up v1.34: cluster is running, use KUBECONFIG=/var/run/kubernetes/admin.kubeconfig to access it
    I1208 16:01:05.869679     243 reflector.go:446] "Caches populated" type="*v1.ServiceAccount" reflector="k8s.io/client-go/tools/watch/informerwatcher.go:162"

The first line is printed via framework.Logf, which is meant to emulate the
format used by the klog text logger in the second line. The difference is that
klog formats the pid with 7 characters, padding on the left with spaces.

Consistency trumps brevity here, so let's format exactly as in klog.
2026-01-05 13:45:03 +01:00
Kubernetes Prow Robot
268bdbe214
Merge pull request #135836 from pohly/ginkgo-gomega-update
dependencies: ginkgo v2.27.3 + gomega v1.38.3
2025-12-19 08:36:39 -08:00
Patrick Ohly
db841afdbb dependencies: ginkgo v2.27.3 + gomega v1.38.3
This fixes some issues found in Kubernetes (data race in ginkgo CLI, gomega
formatting) and helps with diagnosing OOM killing in CI jobs (exit status of
processes).

The modified gomega formatting shows up in some of the output tests for the E2E
framework. They get updated accordingly.
2025-12-19 10:37:54 +01:00
hongkang
be9b3d5a46 Add e2e test for VolumeAttachment cleanup when CSIDriver AttachRequired changes
Signed-off-by: hongkang <mzhkcj50@gmail.com>
2025-12-19 15:56:33 +08:00
Kubernetes Prow Robot
243404b870
Merge pull request #134515 from carlory/e2e-autoscaling
e2e: improve test/e2e/framework/autoscaling/autoscaling_utils.go
2025-12-17 16:26:32 -08:00
Stanislav Láznička
805eb885e3
node e2e: add tests for Ensure Secret Image Pulls default policy
Signed-off-by: Stanislav Láznička <slznika@microsoft.com>

Co-authored-by: Anish Ramasekar <anish.ramasekar@gmail.com>
2025-11-11 11:15:53 -05:00
Heba
aceb89debc
KEP-5471: Extend tolerations operators (#134665)
* Add numeric operations to tolerations

Signed-off-by: Heba Elayoty <heelayot@microsoft.com>

* code review feedback

Signed-off-by: Heba Elayoty <heelayot@microsoft.com>

* add default feature gate

Signed-off-by: Heba Elayoty <heelayot@microsoft.com>

* Add integration tests

Signed-off-by: Heba Elayoty <heelayot@microsoft.com>

* Add toleration value validation

Signed-off-by: Heba Elayoty <heelayot@microsoft.com>

* Add validate options for new operators

Signed-off-by: helayoty <heelayot@microsoft.com>

* Remove log

Signed-off-by: helayoty <heelayot@microsoft.com>

* Update feature gate check

Signed-off-by: helayoty <heelayot@microsoft.com>

* emove IsValidNumericString func

Signed-off-by: helayoty <heelayot@microsoft.com>

* Implement IsDecimalInteger

Signed-off-by: helayoty <heelayot@microsoft.com>

* code review feedback

Signed-off-by: helayoty <heelayot@microsoft.com>

* Add logs to v1/toleration

Signed-off-by: Heba Elayoty <heelayot@microsoft.com>
Signed-off-by: helayoty <heelayot@microsoft.com>

* Update integration tests and address code review feedback

Signed-off-by: helayoty <heelayot@microsoft.com>

* Add feature gate to the scheduler framework

Signed-off-by: helayoty <heelayot@microsoft.com>

* Remove extra test

Signed-off-by: helayoty <heelayot@microsoft.com>

* Fix integration test

Signed-off-by: helayoty <heelayot@microsoft.com>

* pass feature gate via TolerationsTolerateTaint

Signed-off-by: helayoty <heelayot@microsoft.com>

---------

Signed-off-by: Heba Elayoty <heelayot@microsoft.com>
Signed-off-by: helayoty <heelayot@microsoft.com>
2025-11-10 12:42:54 -08:00
Anish Ramasekar
d82fa1eb98
test: use localhost and HostNetwork for registry, mark test as disruptive
Signed-off-by: Anish Ramasekar <anish.ramasekar@gmail.com>
2025-11-07 11:13:28 -08:00