Skip to content

Commit 173ca86

Browse files
committed
fix: Evaluate all conditions of a migration job to find out if completed
1 parent 3de661b commit 173ca86

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

internal/resources/datastore/datastore_migrate.go

+5-2
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,11 @@ func (d *Migrate) CreateOrUpdate(ctx context.Context, tenantControlPlane *kamaji
128128
return resources.OperationResultEnqueueBack, nil
129129
case controllerutil.OperationResultNone:
130130

131-
if len(d.job.Status.Conditions) > 0 && d.job.Status.Conditions[0].Type == batchv1.JobComplete && d.job.Status.Conditions[0].Status == corev1.ConditionTrue {
132-
return controllerutil.OperationResultNone, nil
131+
// Note: job.Status.Conditions can contain more than one condition on Kubernetes versions greater than v1.30
132+
for _, condition := range d.job.Status.Conditions {
133+
if condition.Type == batchv1.JobComplete && condition.Status == corev1.ConditionTrue {
134+
return controllerutil.OperationResultNone, nil
135+
}
133136
}
134137

135138
d.inProgress = true

0 commit comments

Comments
 (0)