Commit graph

66 commits

Author SHA1 Message Date
HirazawaUi
acdf891478 add e2e tests 2025-11-01 12:55:01 +08:00
Maria Romano Silva
a277269159 updating sidecar feature to node conformance 2025-10-27 23:43:43 +00:00
Kubernetes Prow Robot
031f4d541a
Merge pull request #133072 from AadiDev005/fix-sidecar-startup-probe
Fix startup probe worker termination for sidecar containers
2025-10-20 12:26:37 -07:00
Tsubasa Nagasawa
bc7ea997a0 deflake e2e: ensure pod with sidecars restarts in correct order after node reboot
Signed-off-by: Tsubasa Nagasawa <toversus2357@gmail.com>
Co-authored-by: Hironori Shiina <shiina.hironori@gmail.com>
2025-09-24 07:36:56 +09:00
aditya
c97f08793c Fix startup probe worker termination for sidecar containers
Fixes a bug where startup probe workers terminate incorrectly for sidecar
containers with restartPolicy=Always when the pod has restartPolicy=Never,
causing main containers to remain stuck in Initializing state.

Changes:
- Add container-level restart policy check for init containers only
- Extract complex boolean logic to named variable for readability
- Refactor test helper to use existing newWorker() function
- Add comprehensive unit and e2e tests for both scenarios
2025-08-17 11:46:09 +05:30
HirazawaUi
7c1d133dff Fix sidecar containers flaky tests 2025-07-28 20:24:52 +08:00
Kubernetes Prow Robot
4dfb8523fc
Merge pull request #128239 from HirazawaUi/fix-e2e-tests
Fix container lifecycle flaking e2e tests
2025-07-21 18:08:25 -07: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
Daniel Shebib
179c4398f3 use defaultImage per OS 2025-07-01 23:17:51 -05:00
Daniel Shebib
998776d80b remove breaking test 2025-07-01 23:06:05 -05:00
Paco Xu
2d7518df6d
Revert "Add e2e test for Regular Container image change" 2025-03-21 11:01:52 +08:00
Kubernetes Prow Robot
a9d0f39b8f
Merge pull request #126794 from dshebib/addRegularContainerImgChangeE2E
Add e2e test for Regular Container image change
2025-03-20 14:16:31 -07:00
Gunju Kim
657ccc3099 Ensure that the pod has the proper phase upon re-initialization
This fixes the pod with restartable init containers to have a proper
phase after the pod sandbox re-creation.

Currently, the `runtime.PodStatus` cannot retrieve the active container
statuses, which are the container statuses associated with the current
pod sandbox. This adds the `ActiveContainerStatuses` to
`runtime.PodStatus`, allowing it to include the container statuses of
the current pod sandbox, and fixes the kubelet to correctly set the pod
Phase to `Pending` when no active regular containers are present.
2025-03-20 17:38:41 +09:00
Daniel Shebib
1ee7d946d7 WIP add tests for regular container image updates 2025-03-19 19:37:58 -05:00
Ayato Tokubi
da5a76bd39 Fix flaky test for container life cycle
Signed-off-by: Ayato Tokubi <atokubi@redhat.com>
2025-01-30 16:23:51 +00:00
HirazawaUi
3dc611e666 fix container lifecycle e2e tests 2025-01-24 14:56:37 +08:00
Kevin Hannon
bae4122f56 deprecate nodefeature for feature labels 2025-01-20 17:02:59 -05:00
Kevin Hannon
8495df64b2 deprecate nodefeature for feature labels 2024-12-17 13:58:12 -05:00
HirazawaUi
53e9f29d29 Fix kubelet e2e tests incorrect message 2024-12-01 22:45:29 +08:00
Ed Bartosh
3aa95dafea e2e_node: refactor stopping and restarting kubelet
Moved Kubelet health checks from test cases to the stopKubelet API.
This should make the API cleaner and easier to use.
2024-11-06 11:34:48 +02:00
Kubernetes Prow Robot
98b4ee6bfa
Merge pull request #126525 from dshebib/addSidecarE2EImgTest
Restart sidecar container when the image has changed
2024-11-06 00:35:35 +00:00
Daniel Shebib
43d527ad68 add restart on definition change 2024-10-18 15:35:06 -05:00
Kubernetes Prow Robot
de8f6b0db7
Merge pull request #128037 from dshebib/e2eNode_containerLifecycleContext
[e2e_node] Use shared context in regular container tests
2024-10-14 13:10:28 +01:00
Daniel Shebib
266d1c886a linter 2024-10-13 10:12:35 -05:00
Daniel Shebib
51883d5821 sidecar containers restart on definition change 2024-10-13 01:21:57 -05:00
Daniel Shebib
1618dbe695 Add context to tests 2024-10-12 21:23:29 -05:00
Tsubasa Nagasawa
04c6d9324e Check for restarts without being affected by container startup order
The test for checking container restarts in a Pod with restartable-init-1
and regular-1 is flaky. Right now, when we check if restartable-init-1 has
restarted, we see if it hasn’t written the "Started" log after regular-1 has
written its "Started" log.
But even though the startup sequence starts with restartable-init-1 and then
regular-1, there’s no guarantee they’ll finish starting up in that order.
Sometimes regular-1 finishes first and writes its "Started" log before restartable-init-1.

1. restartable-init-1 Starting
2. regular-1 Starting
3. regular-1 Started
4. restartable-init-1 Started

In this test, the startup order doesn’t really matter; all we need to check is
if restartable-init-1 restarted. So I changed the test to simply look for
more than one "Starting" log in restartable-init-1's logs.

There were other places that used the same helper function DoesntStartAfter,
so replaced those as well and deleted the helper function.
2024-10-12 15:17:47 +09:00
Tsubasa Nagasawa
82b690ddf6 Add more Node E2E tests to cover pod termination for Sidecar Containers
* A pod with restartable init container that exits with
  a non-zero code is marked as a pod succeeded phase
* A pod with restartable init containers that exits with
  a non-zero code by prestop hook is marked as a pod succeeded phase
* A pod with regular container that exceeds its termination grace period
  seconds is marked as a pod failed phase
* A pod with restartable init containers that exceeds its termination
  grace period seconds is marked as a pod succeeded phase
* A pod with a regular container that exceeded its termination grace
  period seconds by PreStop hook is marked as a pod failed phase
* A pod with restartable init containers that exceeds its termination
  grace period seconds by PreStop hook is marked as a pod succeeded phase

Signed-off-by: Tsubasa Nagasawa <toversus2357@gmail.com>
2024-10-10 09:43:41 +09:00
Tsubasa Nagasawa
bd00f83578 Add step to existing pod termination Node E2E tests to check the container’s exit code
Signed-off-by: Tsubasa Nagasawa <toversus2357@gmail.com>
2024-10-10 09:17:43 +09:00
Daniel Shebib
2d28e6803c typo 2024-10-06 07:40:56 -05:00
Daniel Shebib
7155404eb5 format whitespace 2024-10-05 18:46:26 -05:00
Daniel Shebib
252fb59bf9 Encase tests in When() 2024-10-05 18:46:26 -05:00
Kubernetes Prow Robot
d770dd695a
Merge pull request #121888 from SD-13/e2e-gomega-be-true-or-false
Enhance boolean assertions when fail
2024-08-20 04:24:42 -07:00
Sujay
223aedcf6b enhance boolean assertions 2024-07-31 15:58:15 +00:00
Kubernetes Prow Robot
638128e74f
Merge pull request #119019 from gjkim42/add-e2e-node-test-restarting-the-kubelet
Add node serial e2e tests that simulate the kubelet restart
2024-07-23 18:01:36 -07:00
Kubernetes Prow Robot
fa4b8f32ac
Merge pull request #125935 from gjkim42/fix-125880
Terminate restartable init containers ignoring not-started containers
2024-07-23 15:45:11 -07:00
Gunju Kim
45a243e102
Add node serial e2e tests that simulate the kubelet restart
This adds node e2e tests to make sure a completed init container is not
restarted due to the kubelet restart.
2024-07-19 21:18:34 +09:00
Davanum Srinivas
f6836df520
[e2e-node] Cleanup pods after the test runs
Signed-off-by: Davanum Srinivas <davanum@gmail.com>
2024-07-09 16:53:28 -04:00
Gunju Kim
a03affab78 Terminate restartable init containers ignoring not-started containers
This ensures that the restartable init containers receive a termination
signal even if there are any not-started restartable init containers, by
ignoring the not-running containers.
2024-07-10 05:50:51 +09:00
Matthias Bertschy
367e8c5578 ignore starting order in RunTogether, add another that does
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-06-02 22:00:40 +02:00
Gunju Kim
65b9e560ce
e2e: Increase preStop hook delay to deflake the test
This delays the preStop hook to allow sufficient time for the readiness
probe to be executed.
2024-05-23 21:31:02 +09:00
Maciej Szulik
ceb0387e39
Update PodSecurityLevel used during tests 2024-05-15 16:50:30 +02:00
Matthias Bertschy
18f9a08463 add coverage tests for probes behavior
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-05-07 07:18:27 +02:00
Ed Bartosh
6ecf0da1a5 node_e2e: refactor RunTogether function 2024-05-02 13:41:47 +03:00
Matthias Bertschy
f7ea5f3fe1 e2e lifecycle: increase delay for restartable init containers
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-05-01 22:12:04 +02:00
Matthias Bertschy
851d149a88 e2e lifecycle: use millisecond resolution for logs
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-05-01 18:27:10 +02:00
Ed Bartosh
e4c6adacf0 Revert "add coverage tests for probes behavior"
This reverts commit 9be9832184.
2024-04-24 20:56:46 +03:00
Matthias Bertschy
9be9832184 add coverage tests for probes behavior
Signed-off-by: Matthias Bertschy <matthias.bertschy@gmail.com>
2024-03-27 22:31:47 +01:00
Gunju Kim
1cd1092dd9
Remove NodeAlphaFeature label from sidecar e2e tests 2023-11-06 19:50:05 +09:00
Patrick Ohly
f2cfbf44b1 e2e: use framework labels
This changes the text registration so that tags for which the framework has a
dedicated API (features, feature gates, slow, serial, etc.) those APIs are
used.

Arbitrary, custom tags are still left in place for now.
2023-11-01 15:17:34 +01:00