Skip to content

Commit 1de4c8f

Browse files
fix(test): fix error in ci.
Signed-off-by: Electronic-Waste <[email protected]>
1 parent 34140be commit 1de4c8f

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

pkg/controller.v1beta1/trial/trial_controller_test.go

+4-3
Original file line numberDiff line numberDiff line change
@@ -276,13 +276,14 @@ func TestReconcileBatchJob(t *testing.T) {
276276
batchJobCompleteReason := "BatchJob completed test reason"
277277
g.Eventually(func(g gomega.Gomega) {
278278
g.Expect(c.Get(ctx, succeededBatchJobKey, batchJob)).Should(gomega.Succeed())
279-
// TODO(Electronic-Waste): Remove this condition when K8s 1.30 is no longer supported.
279+
// TODO(Electronic-Waste): Remove this condition when K8s v1.29 & v1.30 is no longer supported.
280280
// SuccessPolicy is available in K8s 1.31 and later. If we set it in K8s 1.30, it will be ignored.
281281
// And when we set the status with `SuccessCriteriaMet`, it will report error:
282282
// "Invalid value: cannot set SuccessCriteriaMet=True for Job without SuccessPolicy".
283283
// Ref: https://kubernetes.io/docs/concepts/workloads/controllers/job/#success-policy.
284-
isK8sVersion130 := strings.Contains(os.Getenv("KUBEBUILDER_ASSETS"), "1.30")
285-
if isK8sVersion130 {
284+
isK8sVersionUnder130 := strings.Contains(os.Getenv("KUBEBUILDER_ASSETS"), "1.30") ||
285+
strings.Contains(os.Getenv("KUBEBUILDER_ASSETS"), "1.29")
286+
if isK8sVersionUnder130 {
286287
batchJob.Status = batchv1.JobStatus{
287288
Conditions: []batchv1.JobCondition{
288289
{

0 commit comments

Comments
 (0)