Commit graph

324 commits

Author SHA1 Message Date
Maciej Szulik
61e5542da9
Replace remote executor code with the DefaultExecutor from kubectl
Signed-off-by: Maciej Szulik <soltysh@gmail.com>
2026-05-11 16:59:31 +02:00
Maciej Szulik
8ecec5b156
Eliminate too many ExecWithOptions helpers
Signed-off-by: Maciej Szulik <soltysh@gmail.com>
2026-05-11 16:59:07 +02:00
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
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
Jefftree
b8a17e1ce8 sharding: implement UID-based sharding for list and watch (KEP-5866) 2026-03-17 16:44:15 -04:00
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
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
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
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
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
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
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
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
Jordan Liggitt
4b0eeeb618
Make pod-security-admission honor emulation version 2025-09-17 15:32:32 -04:00
Kubernetes Prow Robot
18c188467d
Merge pull request #133438 from saschagrunert/timeout-pod-should-get-evicted
Increase termination timeout for `evicted pods should be terminal` test
2025-09-03 03:53:14 -07:00
Kubernetes Prow Robot
15b9222fa7
Merge pull request #133477 from chenggu88/e2e
Allow IfNotPresent to be used in node e2e tests
2025-09-03 02:11:16 -07:00
Sascha Grunert
c8f8f66e6d
Increase termination timeout for evicted pods should be terminal test
This doubles the termination timeout for the eviction test from 5min to
10min. Reason for that is that the eviction manager relies on pod stats
metrics, which may not be acceessible during a period of time because of
the kubelet API unreachable. This could be reasoned in hardware or
network pressure when multiple tests run in parallel.

Signed-off-by: Sascha Grunert <sgrunert@redhat.com>
2025-09-03 08:58:46 +02:00
Cheng Gu
ddffd8e389 Allow IfNotPresent to be used in node e2e tests
Currently the node e2e tests overrides the image pull policy to PullNever,
if the policy is not PullAlways.
2025-08-11 22:28:20 +00:00
Jan Safranek
1ea4720268 Add e2e test for SELinuxMount to CSI drivers 2025-08-08 14:25:24 +02:00
HirazawaUi
8d65e1e98e Add e2e tests. 2025-07-23 22:57:11 +08:00
ylink-lfs
fb4e252224 test: add batch pod deletion for kubelet e2e tests 2025-07-19 14:13:59 +08:00
Kubernetes Prow Robot
7fa6cdde88
Merge pull request #127630 from dshebib/e2eNode_UpdateToAgnhost
[e2e_node] containers_lifecycle update from busybox to agnhost
2025-07-18 15:24:25 -07:00
PatrickLaabs
2f7148782b chore: depr. pointer pkg replacement for test/e2e and utils 2025-07-06 22:18:03 +02:00
Daniel Shebib
179c4398f3 use defaultImage per OS 2025-07-01 23:17:51 -05:00
carlory
d5a56739ce use framework.ExpectNoError instead
Co-authored-by: Patrick Ohly <patrick.ohly@intel.com>
Signed-off-by: carlory <baofa.fan@daocloud.io>
2025-05-11 13:12:29 +08:00
Kubernetes Prow Robot
73b5f84cb6
Merge pull request #131487 from hshiina/dedup-cgroup-verification
e2e: Deduplicate cgroup verification
2025-05-06 04:03:17 -07:00
Jordan Liggitt
6bb6c99342
Drop null creationTimestamp from test fixtures 2025-05-02 15:38:40 -04:00
Hironori Shiina
7e1cec680e e2e: Deduplicate cgroup verification
This fix deduplicates cgroup verification in tests for
InPlacePodVerticalScaling and PodLevelResources.
2025-05-01 14:53:26 +02:00
Natasha Sarkar
932cff5dd4 add more error details to the failing cgroup check 2025-04-24 15:51:08 +00:00
Kubernetes Prow Robot
4bcaa515c9
Merge pull request #131267 from tallclair/resize-helpers
Move pod resize e2e utilities out of e2e/framework
2025-04-24 01:28:44 -07:00
Tim Allclair
947a9f26fa Move pod resize e2e utilities out of e2e/framework 2025-04-23 14:02:36 -07:00
Hironori Shiina
5a14fdbf7f e2e: Keep original error when exec in container fails 2025-03-28 11:18:33 +00:00
Kubernetes Prow Robot
bdda0a530e
Merge pull request #131090 from natasha41575/deflakeCgroupNotFound
[FG:InPlacePodVerticalScaling] deflake - wait for containers to have started before doing cgroup check
2025-03-28 00:54:34 -07:00
Natasha Sarkar
5c7491bf08
accept rounded container cpu limits in container cgroup tests (#131059) 2025-03-27 23:40:34 -07:00
Natasha Sarkar
d349ac57e4 wait for containers to have started before doing cgroup check 2025-03-27 20:52:44 +00:00
Natasha Sarkar
83bb5d5705
deflake restart count assertions in in-place resize tests (#131055) 2025-03-27 07:56:40 -07:00
vinay kulkarni
d62e766dad Fix function comment 2025-03-20 16:13:45 +00:00
vinay kulkarni
1208f25b3f Verify oom_score_adj for containers that have been restarted in pod resize e2e 2025-03-20 05:57:41 +00:00
vinay kulkarni
7fe7754e67 Fix unit test, remove wait after resize 2025-03-19 21:27:32 +00:00
vinay kulkarni
7f4b9a52db Consider memory requests in determining if resize is in progress, set termination grace period to 0 2025-03-19 19:11:21 +00:00
vinay kulkarni
951e33fdf9 Fix gofmt issues 2025-03-19 15:13:44 +00:00
vinay kulkarni
917c4b310b Fix lint issues, use kuberuntime's minGracePeriod const, boost container restart wait period 2025-03-19 13:26:01 +00:00
vinay kulkarni
d5d008a6bd Invoke UpdateContainerResources or trigger container restarts (for RestartContainer policy) when memory requests are resized 2025-03-19 06:33:27 +00:00
Natasha Sarkar
4c2be4bdde kubelet sets observedGeneration in conditions 2025-03-18 15:43:24 +00:00
Natasha Sarkar
a15520fbea Move pod resize status to pod conditions 2025-03-17 22:01:05 +00:00
Kubernetes Prow Robot
07d66d9c26
Merge pull request #130574 from natasha41575/drop_proposed_resize_status
[FG:InPlacePodVerticalScaling] Drop `Proposed` resize status
2025-03-11 09:49:46 -07:00
Natasha Sarkar
8a20e90839 [FG:InPlacePodVerticalScaling] Drop 'Proposed' resize status 2025-03-10 20:46:02 +00:00
Kubernetes Prow Robot
2effa5e3cf
Merge pull request #130352 from natasha41575/kubelet-pod-observedgen
[FG:PodObservedGenerationTracking] Kubelet sets pod `status.observedGeneration` when updating the pod status
2025-03-07 13:33:45 -08:00
carlory
0a32e7d6e7 make sure that container is running when execute kubelet exec command
Signed-off-by: carlory <baofa.fan@daocloud.io>
2025-03-07 14:42:21 +08:00
Natasha Sarkar
40e7d88f02 Kubelet sets pod.status.observedGeneration behind FG 2025-03-06 22:31:04 +00:00