fix: evaluate all conditions of a migration job to find out if completed (#706)

This commit is contained in:
Johann Wagner
2025-02-28 16:17:20 +01:00
committed by GitHub
parent 3de661b4e6
commit 899da1aec4

View File

@@ -128,8 +128,11 @@ func (d *Migrate) CreateOrUpdate(ctx context.Context, tenantControlPlane *kamaji
return resources.OperationResultEnqueueBack, nil
case controllerutil.OperationResultNone:
if len(d.job.Status.Conditions) > 0 && d.job.Status.Conditions[0].Type == batchv1.JobComplete && d.job.Status.Conditions[0].Status == corev1.ConditionTrue {
return controllerutil.OperationResultNone, nil
// Note: job.Status.Conditions can contain more than one condition on Kubernetes versions greater than v1.30
for _, condition := range d.job.Status.Conditions {
if condition.Type == batchv1.JobComplete && condition.Status == corev1.ConditionTrue {
return controllerutil.OperationResultNone, nil
}
}
d.inProgress = true