PR updates
Updated the creation of the JobList in the setScheduledJobStatus
function.
@@ -464,12 +464,8 @@ func (r *Reconciler) setScheduledJobStatus(ctx context.Context,
items []unstructured.Unstructured) {
log := logging.FromContext(ctx)
- uList := &unstructured.UnstructuredList{}
- uList.Items = items
+ uList := &unstructured.UnstructuredList{Items: items}
var jobList batchv1.JobList
-
- for _, u := range uList.Items {
- if u.GetKind() == "Job" {
if err := runtime.DefaultUnstructuredConverter.
FromUnstructured(uList.UnstructuredContent(), &jobList); err != nil {
// as this is only setting a status that is not otherwise used
@@ -479,8 +475,6 @@ func (r *Reconciler) setScheduledJobStatus(ctx context.Context,
"unable to set scheduled backup status")
return
}
- }
- }
// TODO(tjmoore4): PGBackRestScheduledBackupStatus can likely be combined with
// PGBackRestJobStatus as they both contain most of the same information
