Commit Graph

160 Commits

Author SHA1 Message Date
Yuki Iwai
be3316e2e1 Job: Fix a bug that the SuccessCriteriaMet condition is added to the Job with successPolicy even if the JobSuccessPolicy featureGate is disabled
Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>
2024-06-12 00:36:36 +09:00
Dejan Pejchev
01536f5a84
add additional tests to make sure job controller logic is correct when counting terminating pods with enabled and disabled PodReplacementPolicy feature 2024-06-06 11:40:54 +02:00
Dejan Pejchev
7dd2948620
count terminating pods when deleting active pods for failed jobs 2024-06-04 11:31:00 +02:00
Michal Wozniak
a6c9d5ba00 Do not remove Job's finalizer from Pod owned by a non-batch/v1 Job 2024-05-14 17:29:23 +02:00
Alvaro Aleman
6d0ac8c561 Use the generic/typed workqueue throughout
This change makes us use the generic workqueue throughout the project in
order to improve type safety and readability of the code.
2024-05-04 14:33:12 -04:00
Marek Siarkowicz
3ee8178768 Cleanup defer from SetFeatureGateDuringTest function call 2024-04-24 20:25:29 +02:00
Yuki Iwai
f2508df279 Job: Use the fake clock in TestTrackJobStatusAndRemoveFinalizers
Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>
2024-03-09 06:09:05 +09:00
Yuki Iwai
e216742672 Job: Support for the JobSuccessPolicy (alpha)
Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>
2024-03-08 05:49:09 +09:00
Michał Woźniak
e568a77a93
Support for the Job managedBy field (alpha) (#123273)
* support for the managed-by label in Job

* Use managedBy field instead of managed-by label

* Additional review remarks

* Review remarks 2

* review remarks 3

* Skip cleanup of finalizers for job with custom managedBy

* Drop the performance optimization

* imrpove logs
2024-03-05 09:25:15 -08:00
Kubernetes Prow Robot
d687dc4772
Merge pull request #122261 from mimowo/unit-tests-for-job-controller-fix
Add unit test for Job Controller for panic when PodFailurePolicy is used on 1.28
2023-12-14 07:27:48 +01:00
Dejan Zele Pejchev
31710a799d
fix: Refactor TestFinalizerCleanup unit test by asserting job and pod informer state (#121856)
* fix: change informer resync period in TestFinalizerCleanup unit test

* refactor TestFinalizerCleanup to avoid flakiness by asserting job and pod informer state

* minor cleanups in TestFinalizerCleanup test in job_controller_test.go

another minor cleanup in TestFinalizerCleanup test in job_controller_test.go

* reduce poll time to 10ms in TestFinalizerCleanup in job_controller_test.go when waiting for podStore cache to get updated

* remove a whitespace from TestFinalizerCleanup to keep diff smaller
2023-12-13 23:55:28 +01:00
Michal Wozniak
34bc590418 Add unit test for Job Controller for panic when PodFailurePolicy is used on 1.28 2023-12-11 11:08:46 +01:00
Dejan Pejchev
e98c33bfaf
switch feature flag to beta for pod replacement policy and add e2e test
update pod replacement policy feature flag comment and refactor the e2e test for pod replacement policy

minor fixes for pod replacement policy and e2e test

fix wrong assertions for pod replacement policy e2e test

more fixes to pod replacement policy e2e test

refactor PodReplacementPolicy e2e test to use finalizers

fix unit tests when pod replacement policy feature flag is promoted to beta

fix podgc controller unit tests when pod replacement feature is enabled

fix lint issue in pod replacement policy e2e test

assert no error in defer function for removing finalizer in pod replacement policy e2e test

implement test using a sh trap for pod replacement policy

reduce sleep after SIGTERM in pod replacement policy e2e test to 5s
2023-10-26 21:50:37 +02:00
Kubernetes Prow Robot
8149ab3f3f
Merge pull request #121356 from mimowo/backoff-limit-per-index-beta
Graduate BackoffLimitPerIndex to Beta
2023-10-23 18:39:58 +02:00
Anton Stuchinskii
34294cd67f locking feature-gate for ready pods job status 2023-10-20 16:08:54 +02:00
Michal Wozniak
6dd0ad5c0f Graduate BackoffLimitPerIndex to Beta 2023-10-19 12:18:36 +02:00
Yuki Iwai
d7556769e7 Job: Replace deprecated wait functions with supported one
Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>
2023-10-19 00:14:35 +09:00
Kubernetes Prow Robot
6d70013af5
Merge pull request #121147 from kannon92/rm-at-least-no-terminating-count
Remove terminating count from rmAtLeast
2023-10-18 00:44:51 +02:00
Kubernetes Prow Robot
27ff547a14
Merge pull request #121011 from kannon92/job-pod-replacement-policy-feature-on-but-api-specified
Fix panic when enablement of pod replacement policy is skewed
2023-10-17 21:28:48 +02:00
Yuki Iwai
201c30fba8
Job: Handle error returned from AddEventHandler function (#119917)
* Job: Handle error returned from AddEventHandler function

Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>

* Use the error message the similar to CronJob

Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>

* Clean up error messages

Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>

* Put the tesing.T on the second place in the args for the newControllerFromClient function

Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>

* Put the testing.T on the second place in the args for the newControllerFromClientWithClock function

Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>

* Call t.Helper()

Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>

* Put the testing.TB on the second place in the args for the createJobControllerWithSharedInformers function and call tb.Helper() there

Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>

* Put the testing.TB on the second place in the args for the startJobControllerAndWaitForCaches function and call tb.Helper() there

Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>

* Adapt TestFinializerCleanup to the eventhandler error

Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>

---------

Signed-off-by: Yuki Iwai <yuki.iwai.tz@gmail.com>
2023-10-17 21:28:34 +02:00
Kevin Hannon
7a1ac18bc8 Fix panic if there are more terminating pods than active pods
Co-authored-by: Aldo Culquicondor <1299064+alculquicondor@users.noreply.github.com>
2023-10-17 14:50:38 -04:00
Kevin Hannon
d7ee6b9d1b fix possible panic if pod replacement policy is turned on and jobs do not set pod replacement policy 2023-10-11 08:37:50 -04:00
Kevin Hannon
b96a074bcd convert pointer to ptr for job controller 2023-10-05 09:30:01 -04:00
Kevin Hannon
a62eb45ae2 Rename job reasons to JobReasons as part of api review 2023-09-19 13:10:22 -04:00
Kevin Hannon
c6e9fba79b move reasons to api package for job controller 2023-09-14 13:24:29 -04:00
Sharpz7
7e4b5d0d49 Final Fix 2023-09-08 14:44:22 +00:00
Sharpz7
43fc6b5bdb Added suggests changes 2023-09-06 03:05:14 +00:00
Sharpz7
e9be1d7438 Test now has coverage! 2023-08-27 05:06:53 +00:00
Adam McArthur
0bc0256093
Update job_controller_test.go 2023-08-25 08:15:53 -06:00
Sharpz7
22f4b1c56a Static check fix 2023-08-25 11:35:05 +00:00
Sharpz7
70e2deb32f Fixing lint problem 2023-08-25 11:08:59 +00:00
Sharpz7
6ded53ce4d Added back test changes 2023-08-25 10:35:58 +00:00
Sharpz7
5fb049ff47 Added create job & cleanup 2023-08-25 10:35:58 +00:00
Sharpz7
ff1659cb79 Added syncjob 2023-08-25 10:35:58 +00:00
Sharpz7
f87cc43cdb Review Changes 2023-08-25 10:35:58 +00:00
Sharpz7
d08fc3a4d0 Another one creeped in 2023-08-25 10:35:58 +00:00
Sharpz7
ef6a0eb6d8 Final Lint Fix 2023-08-25 10:35:58 +00:00
Sharpz7
aa9f38c36d More Lint Fixes 2023-08-25 10:35:58 +00:00
Sharpz7
601679446a Lint fixes 2023-08-25 10:35:58 +00:00
Sharpz7
cf32ae9453 Initial Commit 2023-08-25 10:35:58 +00:00
kannon92
f73c253acc fix typos for pod replacement policy 2023-08-09 20:34:48 +00:00
Kubernetes Prow Robot
a30f6b7922
Merge pull request #119506 from mimowo/fix-job-controller-flaky-test
Fix the flaky TestJobApiBackoffReset test
2023-07-21 09:30:07 -07:00
Michal Wozniak
dbea279112 Fix the flaky TestJobApiBackoffReset test 2023-07-21 14:45:04 +02:00
kannon92
74fcf3e766 implementation of PodReplacementPolicy kep in the job controller 2023-07-21 00:44:53 +00:00
Michal Wozniak
35d0af9243 Include ignored pods when computing backoff delay for Job pod failures 2023-07-19 17:39:58 +02:00
Michał Woźniak
a15c27661e
Job controller implementation of backoff limit per index (#118009) 2023-07-18 13:44:11 -07:00
Kubernetes Prow Robot
6f3856f953
Merge pull request #118883 from danielvegamyhre/kep-4017-job
Add completion index as pod label for indexed jobs
2023-07-14 12:23:50 -07:00
Daniel Vega-Myhre
037091284e fix unit test bug 2023-07-13 22:38:21 +00:00
Daniel Vega-Myhre
1ae60c0ed1 use job completion index annotation as label 2023-07-13 21:04:37 +00:00
Patrick Ohly
7d064812bb kube-controller-manager: finish conversion to contextual logging
This removes all exceptions and fixes the remaining unconverted log calls.
2023-07-12 14:57:29 +02:00